Convert IntersectionObserver over to using RuntimeEnabledFeatures so it can be proper...
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-11-26  Sam Weinig  <sam@webkit.org>
2
3         Convert IntersectionObserver over to using RuntimeEnabledFeatures so it can be properly excluded from script
4         https://bugs.webkit.org/show_bug.cgi?id=164965
5
6         Reviewed by Simon Fraser.
7
8         * Shared/WebPreferencesDefinitions.h:
9         * UIProcess/API/C/WKPreferences.cpp:
10         (WKPreferencesSetIntersectionObserverEnabled):
11         (WKPreferencesGetIntersectionObserverEnabled):
12         * UIProcess/API/C/WKPreferencesRefPrivate.h:
13         * WebProcess/WebPage/WebPage.cpp:
14         (WebKit::WebPage::updatePreferences):
15         Add a preference, defaulting to off, for enabling IntersectionObserver.
16
17 2016-11-26  Simon Fraser  <simon.fraser@apple.com>
18
19         Migrate some layout timer-related code from std::chrono to Seconds and MonotonicTime
20         https://bugs.webkit.org/show_bug.cgi?id=164992
21
22         Reviewed by Darin Adler.
23         
24         No more ugly conversion from seconds to milliseconds.
25
26         * WebProcess/WebPage/WebPage.cpp:
27         (WebKit::WebPage::updatePreferences):
28         * WebProcess/WebPage/ios/WebPageIOS.mm:
29         (WebKit::WebPage::eventThrottlingDelay):
30
31 2016-11-25  Michael Catanzaro  <mcatanzaro@igalia.com>
32
33         [GTK] Follow-up fixes to r208974
34         https://bugs.webkit.org/show_bug.cgi?id=164771
35
36         Unreviewed, implement Carlos's review feedback.
37
38         * UIProcess/API/gtk/WebKitNotification.cpp:
39         (webkit_notification_get_tag):
40         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
41         (WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag):
42         (WebKitNotificationProvider::show):
43         * UIProcess/API/gtk/WebKitNotificationProvider.h:
44
45 2016-11-24  Michael Catanzaro  <mcatanzaro@igalia.com>
46
47         [GTK] Notifications API does not expose or respect the "tag" attribute
48         https://bugs.webkit.org/show_bug.cgi?id=164771
49
50         Reviewed by Gustavo Noronha Silva.
51
52         Expose a tag property on WebKitNotification. Ensure that any previous notification with the
53         same tag is closed when showing a new notification with that tag.
54
55         * UIProcess/API/gtk/WebKitNotification.cpp:
56         (webkit_notification_class_init):
57         (webkitNotificationCreate):
58         (webkit_notification_get_tag):
59         * UIProcess/API/gtk/WebKitNotification.h:
60         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
61         (WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag):
62         (WebKitNotificationProvider::show):
63         * UIProcess/API/gtk/WebKitNotificationProvider.h:
64         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
65
66 2016-11-22  Sergio Villar Senin  <svillar@igalia.com>
67
68         [GTK] Fix introspection warning
69         https://bugs.webkit.org/show_bug.cgi?id=165026
70
71         Reviewed by Michael Catanzaro.
72
73         This fixes an introspection annotation for a new API added in r208532.
74
75         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
76         (webkit_web_page_class_init):
77
78 2016-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
79
80         [SOUP] Simplify custom protocols handler implementation
81         https://bugs.webkit.org/show_bug.cgi?id=164922
82
83         Reviewed by Michael Catanzaro.
84
85         We are using too many classes for this and also the C API that is not needed, because both GTK+ and EFL have
86         their own APIs and this is not used by WTR at all.
87
88         * PlatformEfl.cmake: Remove files from compilation.
89         * PlatformGTK.cmake: Ditto.
90         * Shared/API/c/WKBase.h:
91         * Shared/API/c/soup/WKBaseSoup.h: Removed.
92         * UIProcess/API/APICustomProtocolManagerClient.h: Added.
93         (API::CustomProtocolManagerClient::~CustomProtocolManagerClient):
94         (API::CustomProtocolManagerClient::startLoading):
95         (API::CustomProtocolManagerClient::stopLoading):
96         (API::CustomProtocolManagerClient::invalidate):
97         * UIProcess/API/C/WKAPICast.h:
98         * UIProcess/API/C/soup/WKAPICastSoup.h: Removed.
99         * UIProcess/API/C/soup/WKContextSoup.h: Removed.
100         * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp: Removed.
101         * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h: Removed.
102         * UIProcess/API/C/soup/WKSoupRequestManager.h: Removed.
103         * UIProcess/API/efl/ewk_context.cpp: Remove unneeded include.
104         * UIProcess/API/efl/ewk_url_scheme_request.cpp: Use CustomProtocolManagerProxy instead of WKSoupCustomProtocolRequestManagerRef.
105         (EwkUrlSchemeRequest::EwkUrlSchemeRequest):
106         (EwkUrlSchemeRequest::finish):
107         (EwkUrlSchemeRequest::invalidate):
108         * UIProcess/API/efl/ewk_url_scheme_request_private.h:
109         (EwkUrlSchemeRequest::create):
110         (EwkUrlSchemeRequest::manager):
111         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp: Added.
112         (attachCustomProtocolManagerClientToContext):
113         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.h.
114         * UIProcess/API/gtk/WebKitPrivate.h:
115         * UIProcess/API/gtk/WebKitRequestManagerClient.cpp: Removed.
116         * UIProcess/API/gtk/WebKitRequestManagerClient.h: Removed.
117         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp: Use CustomProtocolManagerProxy instead of WebSoupCustomProtocolRequestManager.
118         (webkitURISchemeRequestCreate):
119         (webkitURISchemeRequestCancel):
120         (webkitURISchemeRequestGetManager):
121         (webkitURISchemeRequestInvalidate):
122         (webkitURISchemeRequestReadCallback):
123         (webkit_uri_scheme_request_finish_error):
124         * UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h:
125         * UIProcess/API/gtk/WebKitWebContext.cpp:
126         (webkitWebContextConstructed):
127         (webkitWebContextDispose):
128         (webkit_web_context_register_uri_scheme):
129         (webkitWebContextStartLoadingCustomProtocol):
130         (webkitWebContextInvalidateCustomProtocolRequests):
131         * UIProcess/API/gtk/WebKitWebContextPrivate.h:
132         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
133         * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
134         (WebKit::CustomProtocolManagerProxy::processDidClose):
135         * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
136         (WebKit::CustomProtocolManagerProxy::processDidClose): Invalidate the client.
137         (WebKit::CustomProtocolManagerProxy::startLoading): Notify the client.
138         (WebKit::CustomProtocolManagerProxy::stopLoading): Ditto.
139         (WebKit::CustomProtocolManagerProxy::didReceiveResponse): Notify the network process.
140         (WebKit::CustomProtocolManagerProxy::didLoadData): Ditto.
141         (WebKit::CustomProtocolManagerProxy::didFailWithError): Ditto.
142         (WebKit::CustomProtocolManagerProxy::didFinishLoading): Ditto.
143         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp: Removed.
144         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.h: Removed.
145         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp: Removed.
146         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.h: Removed.
147         * UIProcess/Network/NetworkProcessProxy.cpp:
148         (WebKit::NetworkProcessProxy::didClose): Notify the CustomProtocolManagerProxy.
149         * UIProcess/WebProcessPool.cpp:
150         (WebKit::WebProcessPool::WebProcessPool): Initialize the CustomProtocolManagerClient and remove the all supplement.
151         (WebKit::WebProcessPool::setCustomProtocolManagerClient):
152         (WebKit::WebProcessPool::registerSchemeForCustomProtocol): In case of soup cache the given protocol.
153         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): In case of soup delete the given protocol from the cache.
154         * UIProcess/WebProcessPool.h:
155         * UIProcess/efl/RequestManagerClientEfl.cpp: Do not use the C API, but API::CustomProtocolManagerClient.
156         (WebKit::RequestManagerClientEfl::RequestManagerClientEfl):
157         (WebKit::RequestManagerClientEfl::registerURLSchemeHandler):
158         * UIProcess/efl/RequestManagerClientEfl.h:
159         * UIProcess/efl/WebProcessPoolEfl.cpp:
160         * UIProcess/gtk/WebProcessPoolGtk.cpp:
161         * UIProcess/soup/WebProcessPoolSoup.cpp:
162         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Use m_urlSchemesRegisteredForCustomProtocols to
163         build the list of custom protocols to send to the network process.
164
165 2016-11-21  Alex Christensen  <achristensen@webkit.org>
166
167         Fix Sierra CMake build after r208452
168         https://bugs.webkit.org/show_bug.cgi?id=164437
169
170         * UIProcess/Cocoa/WebViewImpl.mm:
171         (WebKit::WebViewImpl::updateMediaTouchBar):
172         I haven't enabled VIDEO_PRESENTATION_MODE in the CMake build yet.
173         It's needed for WebPlaybackSessionInterfaceMac to exist.
174
175 2016-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
176
177         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.2 release.
178
179         * gtk/NEWS: Add release notes for 2.15.2.
180
181 2016-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
182
183         Remove m_customProtocolManagerProxy from WebProcessProxy
184         https://bugs.webkit.org/show_bug.cgi?id=164908
185
186         Reviewed by Andreas Kling.
187
188         Since the network process is mandatory, the custom protocol manager proxy of WebProcessProxy is unused and can
189         be removed.
190
191         * UIProcess/WebProcessProxy.cpp:
192         (WebKit::WebProcessProxy::WebProcessProxy):
193         * UIProcess/WebProcessProxy.h:
194
195 2016-11-20  Zan Dobersek  <zdobersek@igalia.com>
196
197         [EncryptedMedia] Make EME API runtime-enabled
198         https://bugs.webkit.org/show_bug.cgi?id=164927
199
200         Reviewed by Jer Noble.
201
202         Add the new EncryptedMediaAPI preference. Set the same feature
203         flag on the shared RuntimeEnabledFeatures object to the
204         corresponding value that's stored in the WebPreferencesStore.
205
206         InjectedBundle::overrideBoolPreferenceForTestRunner() does the
207         same when the 'WebKitEncryptedMediaAPIEnabled' preference is
208         overridden in WKTR for testing purposes.
209
210         * Shared/WebPreferencesDefinitions.h:
211         * WebProcess/InjectedBundle/InjectedBundle.cpp:
212         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
213         * WebProcess/WebPage/WebPage.cpp:
214         (WebKit::WebPage::updatePreferences):
215
216 2016-11-19  Antti Koivisto  <antti@apple.com>
217
218         Salt network cache hashes
219         https://bugs.webkit.org/show_bug.cgi?id=164924
220
221         Reviewed by Alex Christensen.
222
223         To enhance privacy make cache content unidentifiable from file names alone.
224         This is done by generating a unique persistent salt for each cache instance.
225         It is used when computing hashes used in file names.
226
227         The patch also replaces plain text partition directory names with salted hashes.
228
229         * NetworkProcess/cache/NetworkCache.cpp:
230         (WebKit::NetworkCache::Cache::makeCacheKey):
231         (WebKit::NetworkCache::makeCacheKey): Deleted.
232         * NetworkProcess/cache/NetworkCache.h:
233
234             Increment cache version.
235
236         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
237         (WebKit::NetworkCache::BlobStorage::BlobStorage):
238         (WebKit::NetworkCache::BlobStorage::add):
239         (WebKit::NetworkCache::BlobStorage::get):
240
241             Use salt for blob content hash.
242
243         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
244         * NetworkProcess/cache/NetworkCacheData.cpp:
245         (WebKit::NetworkCache::computeSHA1):
246
247             For simplicity all SHA1s are now salted.
248
249         (WebKit::NetworkCache::makeSalt):
250         (WebKit::NetworkCache::readOrMakeSalt):
251
252             Read salt if it exists, generate and persist it otherwise.
253
254         * NetworkProcess/cache/NetworkCacheData.h:
255         * NetworkProcess/cache/NetworkCacheKey.cpp:
256         (WebKit::NetworkCache::Key::Key):
257
258             Remove the "No partition" string and just empty.
259             That was only needed to have a directory name of some sort.
260
261         (WebKit::NetworkCache::Key::computeHash):
262
263             Use salt for key hash.
264
265         (WebKit::NetworkCache::Key::computePartitionHash):
266
267             Separate hash for partition.
268
269         * NetworkProcess/cache/NetworkCacheKey.h:
270         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
271         (WebKit::NetworkCache::makeSubresourcesKey):
272         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
273         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
274         * NetworkProcess/cache/NetworkCacheStorage.cpp:
275         (WebKit::NetworkCache::makeSaltFilePath):
276         (WebKit::NetworkCache::Storage::open):
277
278             Cache can't be opened if we can't read or persist a salt.
279
280         (WebKit::NetworkCache::traverseRecordsFiles):
281         (WebKit::NetworkCache::Storage::Storage):
282         (WebKit::NetworkCache::Storage::synchronize):
283         (WebKit::NetworkCache::Storage::recordDirectoryPathForKey):
284
285             Use the partition hash in the directory name instead of a plain text name.
286
287         (WebKit::NetworkCache::decodeRecordHeader):
288         (WebKit::NetworkCache::Storage::readRecord):
289         (WebKit::NetworkCache::Storage::encodeRecord):
290         (WebKit::NetworkCache::Storage::traverse):
291         (WebKit::NetworkCache::Storage::clear):
292         * NetworkProcess/cache/NetworkCacheStorage.h:
293         (WebKit::NetworkCache::Storage::salt):
294
295 2016-11-19  Simon Fraser  <simon.fraser@apple.com>
296
297         [iOS WK2] When zoomed in and panning on pages with fixed bars, parts of the bars are sometimes missing
298         https://bugs.webkit.org/show_bug.cgi?id=164855
299
300         Reviewed by Sam Weinig.
301
302         During UI-process panning and zooming, we send visible rect updates to the web process
303         with inStableState=false, and don't update GraphicsLayers until we get into a stable state.
304
305         This causes a problem where the web process has a stale notion of where the GraphicsLayers
306         for position:fixed elements are, but is then told to update tiling coverage with an up-to-date
307         visible rect. The existing "sync layer positions" path isn't useful to fix this, because it
308         breaks the relationship between the GraphicsLayer positions and their FixedPositionViewportConstraints
309         in the scrolling tree.
310
311         To address this, add the notion of an Optional<> approximatePosition on GraphicsLayers. This is used
312         only by the coverageRect computation code path, and is cleared by a setPosition(). ApproximatePositions
313         are pushed onto GraphicsLayers via the syncViewportConstrainedLayerPositions() code path (renamed to
314         reconcileViewportConstrainedLayerPositions).
315
316         Tested by scrollingcoordinator/ios/non-stable-viewport-scroll.html
317
318         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
319         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
320         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
321         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
322         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
323         * UIProcess/Scrolling/RemoteScrollingTree.h:
324         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
325         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
326         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
327         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
328         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
329         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
330         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
331         (WebKit::LayerTreeHostGtk::flushPendingLayerChanges):
332         * WebProcess/WebPage/ios/WebPageIOS.mm:
333         (WebKit::WebPage::updateVisibleContentRects): Always push the custom fixed position rect down, but send
334         ScrollingLayerPositionAction::SetApproximate if the state is not stable.
335         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
336         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
337         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
338         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
339
340 2016-11-18  Simon Fraser  <simon.fraser@apple.com>
341
342         Make it possible to test non-stable-state scrolling on iOS
343         https://bugs.webkit.org/show_bug.cgi?id=164905
344
345         Reviewed by Dan Bernstein.
346
347         Make it possible for an iOS layout test to force every visible rect update
348         from the UI process to the web process to be in a non-stable state. This emulates
349         what happens during panning and zooming interactions, and allows us to test the
350         scrolling and layer trees in these transient states.
351
352         This is done by adding a testing property on WKWebView, _stableStateOverride, whose
353         getters and setters are overridden in TestRunnerWKWebView. When non-nil, we _updateVisibleContentRectAfterScrollInView
354         consults the NSNumber's boolValue and uses it to override the stable state.
355
356         To facilitate this kind of testing, also add immediateScrollToOffset() and
357         immediateZoomToScale() to UIScriptController. Finally, add doAfterPresentationUpdate()
358         which provides a callback that fires after one trip to the web process and back.
359
360         * UIProcess/API/Cocoa/WKWebView.mm:
361         (-[WKWebView _updateVisibleContentRectAfterScrollInView:]):
362         (-[WKWebView _stableStateOverride]):
363         (-[WKWebView _setStableStateOverride:]):
364         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
365
366 2016-11-18  Simon Fraser  <simon.fraser@apple.com>
367
368         [iOS WK2] Eliminate a source of flakiness in layout tests by forcing WebPage into "responsive" mode for all tests, with an internals override
369         https://bugs.webkit.org/show_bug.cgi?id=164980
370
371         Reviewed by Chris Dumez.
372
373         WebPage::eventThrottlingDelay() uses a latency estimate based on the round-trip time from the UI process
374         to affect behavior, including whether scroll events are fired. This also affects the FrameView "scrolledByUser"
375         flag that impacts tile coverage.
376
377         During testing, latency falling above or below the 16ms threshold could affect behavior. Fix by forcing
378         WebPage into "responsive" mode while running tests, via InjectedBundlePage::prepare().
379
380         Add a nullable internals property so that a test can specify responsive, unresponsive or default behavior.
381
382         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
383         (WKBundlePageSetEventThrottlingBehaviorOverride):
384         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
385         * WebProcess/WebPage/ios/WebPageIOS.mm:
386         (WebKit::WebPage::eventThrottlingDelay):
387
388 2016-11-18  Simon Fraser  <simon.fraser@apple.com>
389
390         Remove use of std::chrono in WebPage and entrained code
391         https://bugs.webkit.org/show_bug.cgi?id=164967
392
393         Reviewed by Tim Horton.
394
395         Replace std::chrono with Seconds and Monotonic Time.
396
397         Use more C++11 initialization for WebPage data members.
398
399         * Shared/VisibleContentRectUpdateInfo.cpp:
400         (WebKit::operator<<):
401         * Shared/VisibleContentRectUpdateInfo.h:
402         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
403         (WebKit::VisibleContentRectUpdateInfo::timestamp):
404         * Shared/WebCoreArgumentCoders.cpp:
405         (IPC::ArgumentCoder<MonotonicTime>::encode):
406         (IPC::ArgumentCoder<MonotonicTime>::decode):
407         (IPC::ArgumentCoder<Seconds>::encode):
408         (IPC::ArgumentCoder<Seconds>::decode):
409         * Shared/WebCoreArgumentCoders.h:
410         * UIProcess/ios/WKContentView.mm:
411         (WebKit::HistoricalVelocityData::HistoricalVelocityData):
412         (WebKit::HistoricalVelocityData::velocityForNewData):
413         (WebKit::HistoricalVelocityData::append):
414         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
415         * WebProcess/WebCoreSupport/WebChromeClient.h:
416         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
417         (WebKit::WebChromeClient::eventThrottlingDelay):
418         * WebProcess/WebPage/ViewUpdateDispatcher.h:
419         * WebProcess/WebPage/WebPage.cpp:
420         (WebKit::WebPage::WebPage):
421         (WebKit::m_userActivityHysteresis):
422         (WebKit::WebPage::didFlushLayerTreeAtTime):
423         (WebKit::WebPage::didCommitLoad):
424         * WebProcess/WebPage/WebPage.h:
425         * WebProcess/WebPage/ios/WebPageIOS.mm:
426         (WebKit::WebPage::eventThrottlingDelay):
427         (WebKit::WebPage::updateVisibleContentRects):
428         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
429         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
430
431 2016-11-18  Dean Jackson  <dino@apple.com>
432
433         AX: "(inverted-colors)" media query only matches on page reload; should match on change
434         https://bugs.webkit.org/show_bug.cgi?id=163564
435         <rdar://problem/28807350>
436
437         Reviewed by Simon Fraser.
438
439         Listen for the appropriate notifications that accessibility settings
440         have changed. This is a single notification on macOS, which uses WebViewImpl,
441         and more fine-grained notifications on iOS, using WKWebView.
442
443         When we see the notification, send a message to the WebProcess which will
444         then tell the WebCore::Page.
445
446         * UIProcess/API/Cocoa/WKWebView.mm:
447         (-[WKWebView _initializeWithConfiguration:]):
448         (-[WKWebView _accessibilitySettingsDidChange:]):
449         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
450         * UIProcess/Cocoa/WebViewImpl.h:
451         * UIProcess/Cocoa/WebViewImpl.mm:
452         (-[WKAccessibilitySettingsObserver initWithImpl:]):
453         (-[WKAccessibilitySettingsObserver dealloc]):
454         (-[WKAccessibilitySettingsObserver _settingsDidChange:]):
455         (WebKit::WebViewImpl::WebViewImpl):
456         (WebKit::WebViewImpl::accessibilitySettingsDidChange):
457         * UIProcess/WebPageProxy.cpp:
458         (WebKit::WebPageProxy::accessibilitySettingsDidChange):
459         * UIProcess/WebPageProxy.h:
460         * WebProcess/WebPage/WebPage.cpp:
461         (WebKit::WebPage::accessibilitySettingsDidChange):
462         * WebProcess/WebPage/WebPage.h:
463         * WebProcess/WebPage/WebPage.messages.in:
464
465 2016-11-18  Jeremy Jones  <jeremyj@apple.com>
466
467         USE WK_MAC_TBA for version number in _webViewRequestPointerLock:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.12))
468         https://bugs.webkit.org/show_bug.cgi?id=164962
469
470         Reviewed by Dean Jackson.
471
472         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
473
474 2016-11-18  Enrica Casucci  <enrica@apple.com>
475
476         Refactor drag and drop for WebKit2 to encode DragData message exchange.
477         https://bugs.webkit.org/show_bug.cgi?id=164945
478
479         Reviewed by Tim Horton.
480
481         * Shared/WebCoreArgumentCoders.cpp:
482         (IPC::ArgumentCoder<DragData>::encode):
483         (IPC::ArgumentCoder<DragData>::decode):
484         * Shared/WebCoreArgumentCoders.h:
485         * UIProcess/WebPageProxy.cpp:
486         (WebKit::WebPageProxy::performDragControllerAction):
487         * WebProcess/WebCoreSupport/WebDragClient.cpp:
488         (WebKit::WebDragClient::willPerformDragDestinationAction):
489         (WebKit::WebDragClient::actionMaskForDrag):
490         * WebProcess/WebCoreSupport/WebDragClient.h:
491         * WebProcess/WebPage/WebPage.cpp:
492         (WebKit::WebPage::performDragControllerAction):
493         * WebProcess/WebPage/WebPage.h:
494         * WebProcess/WebPage/WebPage.messages.in:
495
496 2016-11-18  Jeremy Jones  <jeremyj@apple.com>
497
498         Add runtime flag to enable pointer lock. Enable pointer lock feature for mac.
499         https://bugs.webkit.org/show_bug.cgi?id=163801
500
501         Reviewed by Simon Fraser.
502
503         Add SPI to notify client of pointer lock and for client to allow or deny.
504         Unlock pointer when view is not longer active.
505
506         * Configurations/FeatureDefines.xcconfig:
507         * Shared/WebPreferencesDefinitions.h:
508         * UIProcess/API/APIUIClient.h:
509         (API::UIClient::requestPointerLock):
510         (API::UIClient::didLosePointerLock):
511         * UIProcess/API/C/WKPage.cpp:
512         (WKPageSetPageUIClient):
513         (WKPageDidAllowPointerLock):
514         (WKPageDidDenyPointerLock):
515         * UIProcess/API/C/WKPagePrivate.h:
516         * UIProcess/API/C/WKPageUIClient.h:
517         * UIProcess/API/C/WKPreferences.cpp:
518         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
519         * UIProcess/Cocoa/UIDelegate.h:
520         * UIProcess/Cocoa/UIDelegate.mm:
521         (WebKit::UIDelegate::setDelegate):
522         (WebKit::UIDelegate::UIClient::requestPointerLock):
523         (WebKit::UIDelegate::UIClient::didLosePointerLock):
524         * UIProcess/WebPageProxy.cpp:
525         (WebKit::WebPageProxy::dispatchActivityStateChange):
526         (WebKit::WebPageProxy::resetStateAfterProcessExited):
527         (WebKit::WebPageProxy::requestPointerLock):
528         (WebKit::WebPageProxy::didAllowPointerLock):
529         (WebKit::WebPageProxy::didDenyPointerLock):
530         (WebKit::WebPageProxy::requestPointerUnlock):
531         * UIProcess/WebPageProxy.h:
532         * WebProcess/WebPage/WebPage.cpp:
533         (WebKit::WebPage::updatePreferences):
534
535 2016-11-17  Carlos Garcia Campos  <cgarcia@igalia.com>
536
537         Downloads started by context menu actions should also have a web view associated
538         https://bugs.webkit.org/show_bug.cgi?id=164364
539
540         Reviewed by Michael Catanzaro.
541
542         When a request is converted to a download WebPageProxy calls handleDownloadRequest() and clients handle that to
543         associate the web view to the download. When a download is started by a context menu action, WebPageProxy calls
544         WebProcessPool::download() with this as initiatingPage parameter, but clients are not notified in this case.
545
546         * UIProcess/API/gtk/WebKitDownload.cpp:
547         (webkitDownloadCreateForRequest): Deleted.
548         * UIProcess/API/gtk/WebKitDownloadPrivate.h:
549         * UIProcess/API/gtk/WebKitWebContext.cpp:
550         (webkitWebContextStartDownload): Use webkitWebContextGetOrCreateDownload() after WebProcessPool::download()
551         because the WebKitDownload could have already been created by the web view download handler at this point.
552         * UIProcess/API/gtk/WebKitWebView.cpp:
553         (webkit_web_view_download_uri): We no longer need to associate the web view to the download here.
554         * UIProcess/WebProcessPool.cpp:
555         (WebKit::WebProcessPool::download): If an initiatingPage has been passed, call handleDownloadRequest() to notify
556         the page client.
557
558 2016-11-17  Alex Christensen  <achristensen@webkit.org>
559
560         REGRESSION: API test _WKDownload.ConvertResponseToDownload is a flaky timeout
561         https://bugs.webkit.org/show_bug.cgi?id=164631
562
563         Reviewed by Carlos Garcia Campos.
564
565         * NetworkProcess/NetworkResourceLoader.cpp:
566         (WebKit::NetworkResourceLoader::convertToDownload):
567         I could reproduce the flaky failure 100% of the time when not using NETWORK_SESSION
568         by adding a usleep(1000000) in NetworkResourceLoader::convertToDownload.  m_networkLoad
569         was not being set to nullptr before it was being checked in NetworkResourceLoader::abort
570
571 2016-11-17  Alex Christensen  <achristensen@webkit.org>
572
573         Fix CMake build after r208865
574         https://bugs.webkit.org/show_bug.cgi?id=164894
575
576         * PlatformMac.cmake:
577         Add new files.
578
579 2016-11-17  Ryosuke Niwa  <rniwa@webkit.org>
580
581         WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled should keep text replacement enabled
582         https://bugs.webkit.org/show_bug.cgi?id=164857
583         <rdar://problem/27721742>
584
585         Reviewed by Wenson Hsieh.
586
587         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
588         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementSpellcheckEnabled):
589
590 2016-11-17  John Wilander  <wilander@apple.com>
591
592         Resource load statistics: Cover further data records, count removed data records, and only fire handler when needed
593         https://bugs.webkit.org/show_bug.cgi?id=164659
594
595         Reviewed by Andy Estes.
596
597         * UIProcess/WebResourceLoadStatisticsStore.cpp:
598         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
599             Consistent naming with 'remove' rather than 'delete'.
600             Now removes localStorage, IndexDB, disk cache, and memory cache too.
601             Updates statistics with number of times it has removed data records.
602         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
603             No longer checks whether it has enough data since the classification rules
604             are absolute, not relative.
605         (WebKit::WebResourceLoadStatisticsStore::clearDataRecords): Deleted.
606         * UIProcess/WebResourceLoadStatisticsStore.h:
607             Consistent naming with 'remove' rather than 'delete'.
608
609 2016-11-17  Brady Eidson  <beidson@apple.com>
610
611         Add _WKIconLoadingDelegate SPI.
612         https://bugs.webkit.org/show_bug.cgi?id=164894
613
614         Reviewed by Alex Christensen.
615
616         With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.
617
618         WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.
619
620         For icons the app decides to load, WebKit will pass the data to the app without storing locally.
621
622         * UIProcess/API/APIIconLoadingClient.h: Copied from Source/WebCore/html/LinkIconCollector.h.
623         (API::IconLoadingClient::~IconLoadingClient):
624         (API::IconLoadingClient::getLoadDecisionForIcon):
625
626         * UIProcess/API/Cocoa/WKWebView.mm:
627         (-[WKWebView _initializeWithConfiguration:]):
628         (-[WKWebView _iconLoadingDelegate]):
629         (-[WKWebView _setIconLoadingDelegate:]):
630         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
631
632         * UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
633
634         * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Copied from Source/WebCore/html/LinkIconCollector.h.
635         * UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Copied from Source/WebCore/html/LinkIconCollector.h.
636         (-[_WKLinkIconParameters _initWithLinkIcon:]):
637         (-[_WKLinkIconParameters url]):
638         (-[_WKLinkIconParameters mimeType]):
639         (-[_WKLinkIconParameters size]):
640         (-[_WKLinkIconParameters iconType]):
641         * UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Copied from Source/WebCore/html/LinkIconCollector.h.
642
643         * UIProcess/Cocoa/IconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
644         * UIProcess/Cocoa/IconLoadingDelegate.mm: Added.
645         (WebKit::IconLoadingDelegate::IconLoadingDelegate):
646         (WebKit::IconLoadingDelegate::~IconLoadingDelegate):
647         (WebKit::IconLoadingDelegate::createIconLoadingClient):
648         (WebKit::IconLoadingDelegate::delegate):
649         (WebKit::IconLoadingDelegate::setDelegate):
650         (WebKit::IconLoadingDelegate::IconLoadingClient::IconLoadingClient):
651         (WebKit::IconLoadingDelegate::IconLoadingClient::~IconLoadingClient):
652         (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
653
654         * UIProcess/WebPageProxy.cpp:
655         (WebKit::WebPageProxy::setIconLoadingClient):
656         (WebKit::WebPageProxy::getLoadDecisionForIcon):
657         (WebKit::WebPageProxy::finishedLoadingIcon):
658         * UIProcess/WebPageProxy.h:
659         (WebKit::WebPageProxy::iconLoadingClient):
660         * UIProcess/WebPageProxy.messages.in:
661
662         * WebKit2.xcodeproj/project.pbxproj:
663
664         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
665         (WebKit::WebFrameLoaderClient::useIconLoadingClient):
666         (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon):
667         (WebKit::WebFrameLoaderClient::finishedLoadingIcon):
668         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
669         (WebKit::WebFrameLoaderClient::setUseIconLoadingClient):
670
671         * WebProcess/WebPage/WebPage.cpp:
672         (WebKit::WebPage::didGetLoadDecisionForIcon):
673         (WebKit::WebPage::setUseIconLoadingClient):
674         * WebProcess/WebPage/WebPage.h:
675         * WebProcess/WebPage/WebPage.messages.in:
676
677 2016-11-17  Saam Barati  <sbarati@apple.com>
678
679         Remove async/await compile time flag and enable tests
680         https://bugs.webkit.org/show_bug.cgi?id=164828
681         <rdar://problem/28639334>
682
683         Reviewed by Yusuke Suzuki.
684
685         * Configurations/FeatureDefines.xcconfig:
686
687 2016-11-17  Yusuke Suzuki  <utatane.tea@gmail.com>
688
689         [JSC] WTF::TemporaryChange with WTF::SetForScope
690         https://bugs.webkit.org/show_bug.cgi?id=164761
691
692         Reviewed by Saam Barati.
693
694         * PluginProcess/PluginControllerProxy.cpp:
695         (WebKit::PluginControllerProxy::initialize):
696         * PluginProcess/WebProcessConnection.cpp:
697         (WebKit::WebProcessConnection::didReceiveMessage):
698         (WebKit::WebProcessConnection::didReceiveSyncMessage):
699         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
700         (createEncodedObject):
701         (decodeObject):
702         * UIProcess/API/Cocoa/WKWebView.mm:
703         (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
704         * UIProcess/Cocoa/WebViewImpl.mm:
705         (WebKit::WebViewImpl::updateTextTouchBar):
706         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
707         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
708         * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
709         (WebKit::WebPasteboardProxy::writeToClipboard):
710         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
711         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
712         (WebKit::CompositingCoordinator::purgeBackingStores):
713         * WebProcess/WebPage/WebPage.cpp:
714         (WebKit::WebPage::mouseEvent):
715         (WebKit::WebPage::keyEvent):
716         (WebKit::WebPage::dispatchTouchEvent):
717         (WebKit::WebPage::setInitialFocus):
718         (WebKit::WebPage::insertTextAsync):
719         * WebProcess/WebPage/ios/WebPageIOS.mm:
720         (WebKit::WebPage::dynamicViewportSizeUpdate):
721         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
722         * WebProcess/WebPage/mac/WebPageMac.mm:
723
724 2016-11-16  Brent Fulgham  <bfulgham@apple.com>
725
726         Unreviewed build fix after r208589
727
728         The generated com.apple.WebKit.plugin-common.sb file was not getting copied into
729         the Resources folder, so was not deployed with WebKit. We need to treat it like
730         com.apple.WebProcess.sb and the other generated files.
731
732         * WebKit2.xcodeproj/project.pbxproj: Tell Xcode to include the generated file in
733         the framework Resources.
734
735 2016-11-16  Yusuke Suzuki  <utatane.tea@gmail.com>
736
737         [ES6][WebCore] Change ES6_MODULES compile time flag to runtime flag
738         https://bugs.webkit.org/show_bug.cgi?id=164827
739
740         Reviewed by Ryosuke Niwa.
741
742         * Configurations/FeatureDefines.xcconfig:
743         * Shared/WebPreferencesDefinitions.h:
744         Annotated ES6 Modules option with DEFAULT_EXPERIMENTAL_FEATURES_ENABLED.
745         * UIProcess/API/C/WKPreferences.cpp:
746         (WKPreferencesSetES6ModulesEnabled):
747         (WKPreferencesGetES6ModulesEnabled):
748         * UIProcess/API/C/WKPreferencesRefPrivate.h:
749         * WebProcess/InjectedBundle/InjectedBundle.cpp:
750         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
751         * WebProcess/WebPage/WebPage.cpp:
752         (WebKit::WebPage::updatePreferences):
753
754 2016-11-16  Simon Fraser  <simon.fraser@apple.com>
755
756         Add logging support to VisibleContentRectUpdateInfo
757         https://bugs.webkit.org/show_bug.cgi?id=164825
758
759         Reviewed by Zalan Bujtas.
760
761         Add TextStream output to VisibleContentRectUpdateInfo. Just piping it into a logging
762         stream does single-line output, so also make a convenience dump() function that will
763         product multiline output. Result look like:
764
765             (VisibleContentRectUpdateInfo
766               (lastLayerTreeTransactionID 54)
767               (exposedContentRect (523.44,1258.63) width=676.20 height=901.60)
768               (unobscuredContentRect (523.44,1293.41) width=676.20 height=866.82)
769               (unobscuredRectInScrollViewCoordinates (0,39.50) width=768 height=984.50)
770               (customFixedPositionRect (219.64,935) width=980 height=1225)
771               (obscuredInset width=0 height=39.50)
772               (scale 1.14)
773               (inStableState 0)
774               (timestamp 736446.61)
775               (verticalVelocity -11.36))
776
777         * Shared/VisibleContentRectUpdateInfo.cpp:
778         (WebKit::VisibleContentRectUpdateInfo::dump):
779         (WebKit::operator<<):
780         * Shared/VisibleContentRectUpdateInfo.h:
781         * UIProcess/ios/WKContentView.mm:
782         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
783
784 2016-11-15  Simon Fraser  <simon.fraser@apple.com>
785
786         [iOS WK2] Scroll view scrolling and zooming animations can keep running across page loads
787         https://bugs.webkit.org/show_bug.cgi?id=164810
788
789         Reviewed by Tim Horton.
790         
791         Scrolling and zooming animations can leak across page loads, which makes tests flakey,
792         and is unexpected by users.
793
794         Tested by scrollingcoordinator/ios/sync-layer-positions-after-scroll.html followed by
795         scrollingcoordinator/ios/ui-scrolling-tree.html
796
797         * UIProcess/API/Cocoa/WKWebView.mm:
798         (-[WKWebView _didCommitLoadForMainFrame]):
799
800 2016-11-15  Jon Lee  <jonlee@apple.com>
801
802         Report active video and audio capture devices separately
803         https://bugs.webkit.org/show_bug.cgi?id=164769
804
805         Reviewed by Eric Carlson.
806
807         Replace kWKMediaHasActiveCaptureDevice with kWKMediaHasActiveAudioCaptureDevice and
808         kWKMediaHasActiveVideoCaptureDevice
809
810         * UIProcess/API/C/WKPage.cpp:
811         (WKPageGetMediaState):
812         * UIProcess/API/C/WKPagePrivate.h:
813         * UIProcess/WebPageProxy.cpp:
814         (WebKit::WebPageProxy::isPlayingMediaDidChange): Update the mask to include the two
815         bits.
816
817 2016-11-14  Simon Fraser  <simon.fraser@apple.com>
818
819         [iOS WK2] Implement support for visual viewports
820         https://bugs.webkit.org/show_bug.cgi?id=164765
821
822         Reviewed by Tim Horton.
823
824         Adopt the visual viewport scrolling model in iOS WK2.
825
826         Pass the parameters used for computing the layout viewport up to WK2 via RemoteLayerTreeTransaction.
827         These are stored on WebPageProxy. When they change, _didCommitLayerTree triggers a -_updateVisibleContentRects.
828         
829         WebPageProxy::computeCustomFixedPositionRect() is the function that computes the "override" layout viewport.
830         It starts with the baseLayoutViewportSize from the web process (which is based on the initial containing block
831         size), then ensures that it's no smaller than the unobscured content rect, since it makes no sense for the
832         layout viewport to be smaller than the visual viewport. The static FrameView::computeLayoutViewportOrigin()
833         is then use to "push" the layout viewport around as the visual viewport changes.
834
835         * Shared/VisibleContentRectUpdateInfo.h:
836         * Shared/WebCoreArgumentCoders.cpp: Encode LayoutSize and LayoutPoint.
837         (IPC::ArgumentCoder<LayoutSize>::encode):
838         (IPC::ArgumentCoder<LayoutSize>::decode):
839         (IPC::ArgumentCoder<LayoutPoint>::encode):
840         (IPC::ArgumentCoder<LayoutPoint>::decode):
841         * Shared/WebCoreArgumentCoders.h:
842         * Shared/mac/RemoteLayerTreeTransaction.h:
843         (WebKit::RemoteLayerTreeTransaction::baseLayoutViewportSize):
844         (WebKit::RemoteLayerTreeTransaction::setBaseLayoutViewportSize):
845         (WebKit::RemoteLayerTreeTransaction::minStableLayoutViewportOrigin):
846         (WebKit::RemoteLayerTreeTransaction::setMinStableLayoutViewportOrigin):
847         (WebKit::RemoteLayerTreeTransaction::maxStableLayoutViewportOrigin):
848         (WebKit::RemoteLayerTreeTransaction::setMaxStableLayoutViewportOrigin):
849         * Shared/mac/RemoteLayerTreeTransaction.mm:
850         (WebKit::RemoteLayerTreeTransaction::encode):
851         (WebKit::RemoteLayerTreeTransaction::decode):
852         (WebKit::RemoteLayerTreeTransaction::description):
853         * UIProcess/API/Cocoa/WKWebView.mm:
854         (-[WKWebView _didCommitLayerTree:]):
855         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
856         (WebKit::RemoteScrollingCoordinatorProxy::visualViewportEnabled): Accessor.
857         * UIProcess/WebPageProxy.h:
858         (WebKit::WebPageProxy::customFixedPositionRect):
859         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
860         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):
861         * UIProcess/ios/WKContentView.mm:
862         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
863         (-[WKContentView _didCommitLayerTree:]):
864         * UIProcess/ios/WebPageProxyIOS.mm:
865         (WebKit::WebPageProxy::computeCustomFixedPositionRect): When visual viewports are enabled, compute
866         the layout viewport rect, taking the baseLayoutViewportSize and the current unobscured rect into account.
867         (WebKit::WebPageProxy::updateLayoutViewportParameters):
868         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
869         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
870         * WebProcess/WebPage/WebPage.cpp: Encode in the transaction the layout viewport parameters (with minor refactor).
871         (WebKit::WebPage::willCommitLayerTree):
872         * WebProcess/WebPage/ios/WebPageIOS.mm:
873         (WebKit::WebPage::updateVisibleContentRects): This is where the web process receives the new override layout viewport
874         from the web process (with some logging).
875
876 2016-11-15  Jon Lee  <jonlee@apple.com>
877
878         Remove HasMediaCaptureDevice
879         https://bugs.webkit.org/show_bug.cgi?id=164767
880         <rdar://problem/29263696>
881
882         Reviewed by Eric Carlson.
883
884         * UIProcess/API/C/WKPage.cpp: Remove kWKMediaHasCaptureDevice.
885         (WKPageGetMediaState):
886         * UIProcess/API/C/WKPagePrivate.h:
887
888 2016-11-15  Daniel Bates  <dabates@apple.com>
889
890         Disallow loads using HTTP 0.9 at the ResourceHandle/NetworkDataTask level
891         https://bugs.webkit.org/show_bug.cgi?id=164662
892         <rdar://problem/29268514>
893
894         Reviewed by Alex Christensen and Brady Eidson.
895
896         Make changes to NetworkDataTask similar to the changes made to ResourceHandle so as to
897         disallow non-default port HTTP 0.9 loads when using the ENABLE(NETWORK_SESSION) networking
898         code path in WebKit2.
899
900         * NetworkProcess/NetworkDataTask.cpp:
901         (WebKit::NetworkDataTask::didReceiveResponse): Added. Fail the load if it is using HTTP 0.9.
902         Otherwise notify the client that we received a response.
903         * NetworkProcess/NetworkDataTask.h:
904         * NetworkProcess/NetworkDataTaskBlob.cpp:
905         (WebKit::NetworkDataTaskBlob::resume): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
906         as the latter has been renamed to the former.
907         (WebKit::NetworkDataTaskBlob::getSizeForNext): Ditto.
908         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): Renamed from didReceiveResponse().
909         * NetworkProcess/NetworkDataTaskBlob.h:
910         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
911         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
912         (WebKit::NetworkDataTaskCocoa::didReceiveResponse): Deleted.
913         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
914         (WebKit::NetworkDataTaskSoup::didSendRequest): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
915         as the latter has been renamed to the former.
916         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Renamed from didReceiveResponse(). Also
917         remove the local variable response and inline its value into the call to ResourceHandle::didReceiveResponse()
918         as this variable is used exactly once in this function and its name does not describe its purpose any more
919         than its value.
920         (WebKit::NetworkDataTaskSoup::didRequestNextPart): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
921         as the latter has been renamed to the former.
922         * NetworkProcess/soup/NetworkDataTaskSoup.h:
923
924 2016-11-14  Alex Christensen  <achristensen@webkit.org>
925
926         Move SecurityOrigin::createFromDatabaseIdentifier to SecurityOriginData
927         https://bugs.webkit.org/show_bug.cgi?id=164720
928
929         Reviewed by Brady Eidson.
930
931         * DatabaseProcess/DatabaseProcess.cpp:
932         (WebKit::DatabaseProcess::indexedDatabaseOrigins):
933         * DatabaseProcess/DatabaseProcess.h:
934         * NetworkProcess/NetworkProcess.cpp:
935         (WebKit::fetchDiskCacheEntries):
936         * Shared/API/c/WKSecurityOriginRef.cpp:
937         (WKSecurityOriginCreateFromDatabaseIdentifier):
938         * Shared/WebsiteData/WebsiteData.cpp:
939         (WebKit::WebsiteData::Entry::encode):
940         (WebKit::WebsiteData::Entry::decode):
941         * Shared/WebsiteData/WebsiteData.h:
942         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
943         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
944         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
945         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
946         (WebKit::LocalStorageDatabaseTracker::origins):
947         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
948         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
949         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
950         * UIProcess/WebPageProxy.cpp:
951         (WebKit::WebPageProxy::exceededDatabaseQuota):
952         (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
953         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
954         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
955         (WebKit::WebsiteDataStore::fetchData):
956         (WebKit::WebsiteDataStore::removeData):
957         (WebKit::WebsiteDataStore::mediaKeyOrigins):
958         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
959         (WKBundleSetDatabaseQuota):
960         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
961         (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins):
962         * WebProcess/Storage/StorageAreaImpl.cpp:
963         (WebKit::StorageAreaImpl::create):
964         (WebKit::StorageAreaImpl::StorageAreaImpl):
965         (WebKit::StorageAreaImpl::securityOrigin):
966         * WebProcess/Storage/StorageAreaImpl.h:
967         * WebProcess/Storage/StorageAreaMap.cpp:
968         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
969         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
970         * WebProcess/Storage/StorageAreaMap.h:
971         (WebKit::StorageAreaMap::securityOrigin):
972         * WebProcess/Storage/StorageNamespaceImpl.cpp:
973         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
974         (WebKit::StorageNamespaceImpl::storageArea):
975         * WebProcess/Storage/StorageNamespaceImpl.h:
976         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
977         (WebKit::WebChromeClient::exceededDatabaseQuota):
978         * WebProcess/WebProcess.cpp:
979         (WebKit::WebProcess::fetchWebsiteData):
980
981 2016-11-14  Brent Fulgham  <bfulgham@apple.com>
982
983         [Mac][iOS][WK2] Tighten permissions to change CapsLock delay
984         https://bugs.webkit.org/show_bug.cgi?id=164725
985         <rdar://problem/28970910>
986
987         Reviewed by Alexey Proskuryakov.
988
989         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: Limit access
990         to the IOKit connection that actually needs it.
991
992 2016-11-14  Brent Fulgham  <bfulgham@apple.com>
993
994         Unreviewed sandbox fix after r208702
995
996         Correct version check to avoid breaking users in Safari Technology Preview
997         or WebKit nightlies.
998
999         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1000         * WebProcess/com.apple.WebProcess.sb.in:
1001
1002 2016-11-14  Pranjal Jumde  <pjumde@apple.com>
1003
1004         Keychain access in WebKit should be limited to a single process. Earlier this was blocked on the networking framework requiring direct access to keychain, this will be resolved in the upcoming version of macOS.
1005         https://bugs.webkit.org/show_bug.cgi?id=163710
1006         <rdar://problem/24357468>
1007
1008         Reviewed by Darin Adler.
1009
1010         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1011         * WebProcess/com.apple.WebProcess.sb.in:
1012
1013 2016-11-13  Darin Adler  <darin@apple.com>
1014
1015         Remove many includes of ExceptionCode.h
1016         https://bugs.webkit.org/show_bug.cgi?id=164706
1017
1018         Reviewed by Alex Christensen.
1019
1020         * WebProcess/Storage/StorageAreaImpl.cpp: Removed include of ExceptionCode.h.
1021
1022 2016-11-13  Darin Adler  <darin@apple.com>
1023
1024         Fix exception handling in SQL database code, streamline and update code
1025         https://bugs.webkit.org/show_bug.cgi?id=164685
1026
1027         Reviewed by Sam Weinig.
1028
1029         * UIProcess/API/efl/ewk_database_manager.cpp:
1030         (EwkDatabaseManager::getDatabaseOrigins): Update for change to the
1031         DatabaseTracker::origins function.
1032         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1033         (WebKit::WebsiteDataStore::fetchData): Use DatabaseTracker.
1034         (WebKit::WebsiteDataStore::removeData): Ditto.
1035         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1036         (WKBundleSetDatabaseQuota): Ditto.
1037         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1038         (WebKit::WebChromeClient::exceededDatabaseQuota): Ditto.
1039         * WebProcess/WebProcess.cpp:
1040         (WebKit::WebProcess::processWillSuspendImminently): Ditto.
1041
1042 2016-11-12  Simon Fraser  <simon.fraser@apple.com>
1043
1044         Add a way to get the UI-side scrolling tree as text via UIScriptController
1045         https://bugs.webkit.org/show_bug.cgi?id=164697
1046
1047         Reviewed by Zalan Bujtas.
1048
1049         Add a property to WKWebView to retrieve the scrolling tree as text, for testing.
1050         Expose it via the RemoteScrollingCoordinatorProxy.
1051
1052         * UIProcess/API/Cocoa/WKWebView.mm:
1053         (-[WKWebView _scrollingTreeAsText]):
1054         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1055         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
1056         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeAsText):
1057         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
1058
1059 2016-11-12  Daniel Bates  <dabates@apple.com>
1060
1061         Incorrect release log message emitted when waiting/not waiting for the WebProcess continue a load
1062         https://bugs.webkit.org/show_bug.cgi?id=164605
1063
1064         Reviewed by Darin Adler.
1065
1066         Currently we emit a release log message of the form "didReceiveResponse: Should wait for
1067         message from WebContent process ..." when we are not waiting for the WebProcess and emit
1068         a message of the form "didReceiveResponse: Should not wait for message from WebContent
1069         process" when we are waiting on the WebProcess. Invert these messages to reflect whether
1070         we are waiting for the WebProcess to send message NetworkResourceLoader::ContinueDidReceiveResponsewhether.
1071
1072         For the main resource NetworkResourceLoader::didReceiveResponse() returns ShouldContinueDidReceiveResponse::No
1073         because we are waiting for the WebProcess to send message NetworkResourceLoader::ContinueDidReceiveResponse
1074         to continue the load. For a subresource we do not need to wait for the WebProcess to allow the load to continue
1075         and hence NetworkResourceLoader::didReceiveResponse() returns ShouldContinueDidReceiveResponse::Yes.
1076
1077         * NetworkProcess/NetworkResourceLoader.cpp:
1078
1079 2016-11-12  Simon Fraser  <simon.fraser@apple.com>
1080
1081         [iOS WK2] Share some code with Mac for post-async-scroll state reconciliation
1082         https://bugs.webkit.org/show_bug.cgi?id=164694
1083
1084         Reviewed by Zalan Bujtas.
1085
1086         Rather than calling FrameView directly, call reconcileScrollingState() on the scrolling
1087         coordinator.
1088
1089         * WebProcess/WebPage/ios/WebPageIOS.mm:
1090         (WebKit::WebPage::updateVisibleContentRects):
1091
1092 2016-11-12  Brian Burg  <bburg@apple.com>
1093
1094         Web Automation: terminate the automation session if the web process crashes
1095         https://bugs.webkit.org/show_bug.cgi?id=164671
1096         <rdar://problem/29028964>
1097
1098         Reviewed by Joseph Pecoraro.
1099
1100         * UIProcess/Automation/WebAutomationSession.h:
1101         * UIProcess/Automation/WebAutomationSession.cpp:
1102         (WebKit::WebAutomationSession::disconnect):
1103         (WebKit::WebAutomationSession::terminate):
1104         Factor out code that disconnects the remote, unpairs, and notifies the client.
1105         Then, expose terminate() which can be called without a FrontendChannel.
1106         Calling this causes the _WKAutomationDelegate to clear the local-side session in the
1107         browser, and disconnecting from the remote will hang up the remote-side session.
1108
1109         * UIProcess/WebPageProxy.cpp:
1110         (WebKit::WebPageProxy::processDidCrash):
1111         Terminate the session.
1112
1113 2016-11-11  Alex Christensen  <achristensen@webkit.org>
1114
1115         Use SecurityOriginData as keys in StorageManager
1116         https://bugs.webkit.org/show_bug.cgi?id=159834
1117         <rdar://problem/27346948>
1118
1119         Reviewed by Brady Eidson.
1120
1121         * Platform/IPC/HandleMessage.h:
1122         (IPC::callMemberFunctionImpl):
1123         Add a missing std::forward so we can use this callMemberFunctionImpl with rvalues.
1124         * UIProcess/API/C/WKApplicationCacheManager.cpp:
1125         (WKApplicationCacheManagerGetApplicationCacheOrigins):
1126         (WKApplicationCacheManagerDeleteEntriesForOrigin):
1127         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
1128         (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
1129         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
1130         * UIProcess/API/C/WKResourceCacheManager.cpp:
1131         (WKResourceCacheManagerGetCacheOrigins):
1132         (WKResourceCacheManagerClearCacheForOrigin):
1133         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1134         (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
1135         * UIProcess/Databases/DatabaseProcessProxy.cpp:
1136         (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins):
1137         * UIProcess/Databases/DatabaseProcessProxy.h:
1138         * UIProcess/Network/NetworkProcessProxy.cpp:
1139         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
1140         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
1141         * UIProcess/Network/NetworkProcessProxy.h:
1142         * UIProcess/Storage/LocalStorageDatabase.cpp:
1143         (WebKit::LocalStorageDatabase::create):
1144         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
1145         (WebKit::LocalStorageDatabase::openDatabase):
1146         (WebKit::LocalStorageDatabase::close):
1147         * UIProcess/Storage/LocalStorageDatabase.h:
1148         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1149         (WebKit::LocalStorageDatabaseTracker::databasePath):
1150         (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
1151         (WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
1152         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
1153         (WebKit::LocalStorageDatabaseTracker::origins):
1154         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
1155         * UIProcess/Storage/StorageManager.cpp:
1156         (WebKit::StorageManager::StorageArea::securityOrigin):
1157         (WebKit::StorageManager::TransientLocalStorageNamespace::getOrCreateStorageArea):
1158         (WebKit::StorageManager::TransientLocalStorageNamespace::origins):
1159         (WebKit::StorageManager::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
1160         (WebKit::StorageManager::StorageArea::StorageArea):
1161         (WebKit::StorageManager::StorageArea::clone):
1162         (WebKit::StorageManager::StorageArea::items):
1163         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
1164         (WebKit::StorageManager::LocalStorageNamespace::didDestroyStorageArea):
1165         (WebKit::StorageManager::LocalStorageNamespace::clearStorageAreasMatchingOrigin):
1166         (WebKit::StorageManager::LocalStorageNamespace::clearAllStorageAreas):
1167         (WebKit::StorageManager::SessionStorageNamespace::origins):
1168         (WebKit::StorageManager::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
1169         (WebKit::StorageManager::SessionStorageNamespace::cloneTo):
1170         (WebKit::StorageManager::getSessionStorageOrigins):
1171         (WebKit::StorageManager::deleteSessionStorageOrigins):
1172         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
1173         (WebKit::StorageManager::getLocalStorageOrigins):
1174         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
1175         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
1176         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
1177         (WebKit::StorageManager::createLocalStorageMap):
1178         (WebKit::StorageManager::createTransientLocalStorageMap):
1179         (WebKit::StorageManager::createSessionStorageMap):
1180         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
1181         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
1182         (WebKit::StorageManager::StorageArea::create): Deleted.
1183         (WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea): Deleted.
1184         (WebKit::StorageManager::SessionStorageNamespace::getOrCreateStorageArea): Deleted.
1185         * UIProcess/Storage/StorageManager.h:
1186         * UIProcess/WebProcessProxy.cpp:
1187         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
1188         * UIProcess/WebProcessProxy.h:
1189         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
1190         (WebKit::WebsiteDataRecord::displayNameForOrigin):
1191         (WebKit::WebsiteDataRecord::add):
1192         * UIProcess/WebsiteData/WebsiteDataRecord.h:
1193         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1194         (WebKit::WebsiteDataStore::fetchData):
1195         (WebKit::WebsiteDataStore::removeData):
1196         (WebKit::WebsiteDataStore::mediaKeyOrigins):
1197         (WebKit::WebsiteDataStore::removeMediaKeys):
1198         * UIProcess/WebsiteData/WebsiteDataStore.h:
1199         Fewer SecurityOrigin uses in the UIProcess!  Hooray!
1200
1201 2016-11-11  Ryosuke Niwa  <rniwa@webkit.org>
1202
1203         Hovering over a slotted Text node clears hover state
1204         https://bugs.webkit.org/show_bug.cgi?id=164002
1205         <rdar://problem/29040471>
1206
1207         Reviewed by Simon Fraser.
1208
1209         * WebProcess/WebPage/WebPage.cpp:
1210         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
1211         * WebProcess/WebPage/mac/WebPageMac.mm:
1212         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
1213
1214 2016-11-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1215
1216         [WK2] autocorrect and autocapitalize attributes do not work in contenteditable elements
1217         https://bugs.webkit.org/show_bug.cgi?id=164538
1218         <rdar://problem/8418711>
1219
1220         Reviewed by Ryosuke Niwa.
1221
1222         Consult HTMLElement::autocorrect() and HTMLElement::autocapitalizeType() when assembling the assisted node
1223         information for the currently assisted node.
1224
1225         * Shared/AssistedNodeInformation.h:
1226         * UIProcess/ios/WKContentViewInteraction.mm:
1227         (toUITextAutocapitalize):
1228         * WebProcess/WebPage/ios/WebPageIOS.mm:
1229         (WebKit::WebPage::getAssistedNodeInformation):
1230
1231 2016-11-11  Beth Dakin  <bdakin@apple.com>
1232
1233         Move to modern TouchBar methods
1234         https://bugs.webkit.org/show_bug.cgi?id=164655
1235         -and corresponding-
1236         rdar://problem/29226911
1237
1238         Reviewed by Wenson Hsieh.
1239
1240         customizationDefaultItemIdentifiers -> defaultItemIdentifiers
1241         itemIdentifiers -> defaultItemIdentifiers
1242         defaultItems -> templateItems
1243
1244         * UIProcess/Cocoa/WebViewImpl.mm:
1245         (WebKit::plainTextTouchBarDefaultItemIdentifiers):
1246         (WebKit::richTextTouchBarDefaultItemIdentifiers):
1247         (WebKit::WebViewImpl::setUpTextTouchBar):
1248         (WebKit::WebViewImpl::updateTextTouchBar):
1249         (WebKit::plainTextTouchBarCustomizationDefaultItemIdentifiers): Deleted.
1250         (WebKit::richTextTouchBarCustomizationDefaultItemIdentifiers): Deleted.
1251
1252 2016-11-11  Brent Fulgham  <bfulgham@apple.com>
1253
1254         Get rid of old sandbox rules for OS's we no longer support
1255         https://bugs.webkit.org/show_bug.cgi?id=164638
1256
1257         Reviewed by Simon Fraser.
1258
1259         Clean up the various sandbox profiles to get rid of rules that applied to operating system
1260         versions we no longer support, or were added in support of bugs that have long since been
1261         fixed.
1262
1263         This should introduce no change in behavior.
1264
1265         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
1266         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1267         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1268         * Resources/PlugInSandboxProfiles/com.oracle.java.JavaAppletPlugin.sb:
1269         * WebProcess/com.apple.WebProcess.sb.in:
1270
1271 2016-11-11  Brady Eidson  <beidson@apple.com>
1272
1273         IndexedDB 2.0: "close pending flag" and firing blocked events all need fixing.
1274         https://bugs.webkit.org/show_bug.cgi?id=164641
1275
1276         Reviewed by Alex Christensen.
1277
1278         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1279         (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
1280         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
1281         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
1282
1283         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1284         (WebKit::WebIDBConnectionToServer::databaseConnectionPendingClose):
1285         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1286
1287 2016-11-11  Eric Carlson  <eric.carlson@apple.com>
1288
1289         [MediaStream] defer resolution of getUserMedia promise made in a background tab
1290         https://bugs.webkit.org/show_bug.cgi?id=164643
1291         <rdar://problem/29048317>
1292
1293         Reviewed by Brady Eidson.
1294
1295         Do not ask for user for access to capture devices when the document does not
1296         allow media to play, wait until playback is allowed.
1297
1298         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1299         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest):
1300         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
1301         (WebKit::UserMediaPermissionRequestManager::mediaCanStart):
1302         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension):
1303         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1304         * WebProcess/Plugins/PluginView.cpp:
1305         (WebKit::PluginView::mediaCanStart):
1306         * WebProcess/Plugins/PluginView.h:
1307
1308 2016-11-11  Darin Adler  <darin@apple.com>
1309
1310         Move Node from ExceptionCode to ExceptionOr
1311         https://bugs.webkit.org/show_bug.cgi?id=164515
1312
1313         Reviewed by Sam Weinig.
1314
1315         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
1316         (webkit_dom_html_select_element_remove): Updated exception handling.
1317         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp:
1318         (webkit_dom_node_insert_before): Ditto.
1319         (webkit_dom_node_replace_child): Ditto.
1320         (webkit_dom_node_remove_child): Ditto.
1321         (webkit_dom_node_append_child): Ditto.
1322         (webkit_dom_node_clone_node_with_error): Ditto.
1323         (webkit_dom_node_set_node_value): Ditto.
1324         (webkit_dom_node_set_text_content): Ditto.
1325         * WebProcess/InjectedBundle/API/mac/WKDOMNode.mm:
1326         (-[WKDOMNode insertNode:before:]): Ditto.
1327         (-[WKDOMNode appendChild:]): Ditto.
1328         (-[WKDOMNode removeChild:]): Ditto.
1329
1330         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1331         (WebKit::PDFPlugin::PDFPlugin): Removed unneeded ASSERT_NO_EXCEPTION.
1332         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
1333         (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement): Ditto.
1334
1335 2016-11-11  Megan Gardner  <megan_gardner@apple.com>
1336
1337         [Cocoa] Support wide gamut for Drag Image UI
1338         https://bugs.webkit.org/show_bug.cgi?id=164490
1339
1340         Reviewed by Tim Horton.
1341
1342         Fixed an error in the gating for the new wide gamut support in ShareableBitmap.
1343         We should always respect the flags straight out, and not make decisions later, it can lead to mismatched data and data storage.
1344         Added support for wide gamut in createCGImage.
1345
1346         * Shared/cg/ShareableBitmapCG.cpp:
1347         (WebKit::bitmapInfo):
1348         (WebKit::colorSpace):
1349         (WebKit::ShareableBitmap::createGraphicsContext):
1350         (WebKit::ShareableBitmap::createCGImage):
1351         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1352         (WebKit::convertImageToBitmap):
1353         (WebKit::WebDragClient::startDrag):
1354
1355 2016-11-11  Beth Dakin  <bdakin@apple.com>
1356
1357         Get touch bar code building for open source builds
1358         https://bugs.webkit.org/show_bug.cgi?id=164610
1359
1360         Reviewed by Wenson Hsieh.
1361
1362         * config.h:
1363
1364 2016-11-10  Brent Fulgham  <bfulgham@apple.com>
1365
1366         Remove unused FontService from sandbox profile
1367         https://bugs.webkit.org/show_bug.cgi?id=164625
1368         <rdar://problem/26899976>
1369
1370         Reviewed by Alex Christensen.
1371
1372         Part of some general sandbox profile gardening.
1373
1374         Convert the Plugin process sandbox into 
1375
1376         * Configurations/WebKit.xcconfig: Add exclude for com.apple.WebKit.plugin-common.sb.in.
1377         * DerivedSources.make: Update to generate com.apple.WebKit.plugin-common.sb from .in file
1378         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: Copied from Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb.
1379         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: Removed.
1380         * WebKit2.xcodeproj/project.pbxproj: Update for new .in file.
1381         * WebProcess/com.apple.WebProcess.sb.in: Remove com.apple.FontServer
1382         from macOS Sierra and newer.
1383
1384 2016-11-10  Eric Carlson  <eric.carlson@apple.com>
1385
1386         [MediaStream] apply constraints passed to getUserMedia()
1387         https://bugs.webkit.org/show_bug.cgi?id=164561
1388
1389         Reviewed by Youenn Fablet.
1390         <rdar://problem/29191384>
1391
1392         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1393         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1394
1395 2016-11-10  Alex Christensen  <achristensen@webkit.org>
1396
1397         Move SecurityOrigin::databaseIdentifier() to SecurityOriginData
1398         https://bugs.webkit.org/show_bug.cgi?id=164573
1399
1400         Reviewed by Brady Eidson.
1401
1402         * Shared/API/c/WKSecurityOriginRef.cpp:
1403         (WKSecurityOriginCopyDatabaseIdentifier):
1404         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1405         (WebKit::LocalStorageDatabaseTracker::databasePath):
1406         (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
1407         (WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
1408         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1409         (WebKit::WebsiteDataStore::removeMediaKeys):
1410         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
1411         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
1412         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1413         (WKBundlePageCopyOriginsWithApplicationCache):
1414         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
1415         (WebKit::WebMediaKeyStorageManager::mediaKeyStorageDirectoryForOrigin):
1416         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1417         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest):
1418         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
1419         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1420         (WebKit::WebChromeClient::exceededDatabaseQuota):
1421         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
1422
1423 2016-11-10  Alex Christensen  <achristensen@webkit.org>
1424
1425         Remove unused CFURLCACHE code
1426         https://bugs.webkit.org/show_bug.cgi?id=164551
1427
1428         Reviewed by Antti Koivisto.
1429
1430         WebKit2 doesn't use CFURLCache, but we still have some unused code that seems to use it.
1431
1432         * NetworkProcess/NetworkProcess.cpp:
1433         (WebKit::fetchDiskCacheEntries):
1434         (WebKit::clearDiskCacheEntries):
1435         * NetworkProcess/NetworkProcess.h:
1436         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1437         (WebKit::partitionName): Deleted.
1438         (WebKit::NetworkProcess::cfURLCacheOrigins): Deleted.
1439         (WebKit::NetworkProcess::clearCFURLCacheForOrigins): Deleted.
1440
1441 2016-11-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1442
1443         [Linux] Memory process values shown by the WebMemorySampler in linux are wrong
1444         https://bugs.webkit.org/show_bug.cgi?id=164591
1445
1446         Reviewed by Michael Catanzaro.
1447
1448         It's parsing /proc/self/statm, and returning the values as if they were bytes, but they are number of pages, so
1449         to get the bytes we need to take the page size into account. In r208534 I added a method to get /proc/self/statm
1450         values in bytes to Platform layer, so we can simply use that instead.
1451
1452         * Shared/linux/WebMemorySamplerLinux.cpp:
1453         (WebKit::WebMemorySampler::sampleWebKit): Use currentProcessMemoryStatus() and update the descriptions to
1454         clarify that values are in bytes.
1455
1456 2016-10-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1457
1458         MemoryPressureHandler shouldn't know how to release WebCore memory
1459         https://bugs.webkit.org/show_bug.cgi?id=160497
1460
1461         Reviewed by Michael Catanzaro.
1462
1463         Set the low memory handler before installing the memory pressure handler.
1464
1465         * WebProcess/WebProcess.cpp:
1466         (WebKit::WebProcess::initializeWebProcess):
1467         * WebProcess/cocoa/WebProcessCocoa.mm:
1468         (WebKit::WebProcess::platformInitializeWebProcess):
1469
1470 2016-10-27  Sergio Villar Senin  <svillar@igalia.com>
1471
1472         [GTK] New API to notify about dynamically added forms
1473         https://bugs.webkit.org/show_bug.cgi?id=164050
1474
1475         Reviewed by Carlos Garcia Campos.
1476
1477         This new API exports the WebCore event didAssociateFormControls through the web extension
1478         mechanism. This will help clients (mainly web browsers) to implement robust auto filling
1479         mechanisms. It deals nicely with dynamically created forms (and form controls) as many JS
1480         frameworks do nowadays.
1481
1482         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: Added a FormClient implementation of
1483         API::InjectedBundle::FormClient.
1484         (webkitWebPageFormControlsAssociated): Emit the new signal.
1485         (webkit_web_page_class_init): Added the new signal "forms-controls-associated".
1486         (webkitWebPageCreate): Set the WebPage as a FormClient.
1487
1488 2016-11-10  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1489
1490         [GTK] Allow to use WebMemorySampler feature.
1491         https://bugs.webkit.org/show_bug.cgi?id=164517
1492
1493         Reviewed by Carlos Garcia Campos.
1494
1495         Enable the WebMemorySampler with the environment variable WEBKIT_SAMPLE_MEMORY.
1496
1497         When enabled, it will dump the stats to /tmp each second.
1498
1499         * UIProcess/API/gtk/WebKitWebContext.cpp:
1500         (webkitWebContextConstructed):
1501
1502 2016-11-10  Philippe Normand  <pnormand@igalia.com>
1503
1504         [WK2][GTK][GStreamer] Build fails when -plugins-base and -core headers are not installed in the same directory
1505         https://bugs.webkit.org/show_bug.cgi?id=148894
1506
1507         Reviewed by Carlos Garcia Campos.
1508
1509         The pbutils (gst-plugins-base-utils) headers are needed in
1510         WebKit2/GTK for the permission request API related with the
1511         GStreamer codec installer. It builds fine in most cases without
1512         explicitely requiring the pbutils include directory path because
1513         usually all the GStreamer headers are installed in the same path,
1514         excepted for some distributions, like NixOS.
1515
1516         * PlatformGTK.cmake: The GStreamer pbutils include directory was
1517         missing in the header search path.
1518
1519 2016-11-09  Chris Dumez  <cdumez@apple.com>
1520
1521         [WK2][!NETWORK_SESSION] Add support for downloading file backed blobs
1522         https://bugs.webkit.org/show_bug.cgi?id=164522
1523
1524         Reviewed by Alex Christensen.
1525
1526         Add support for downloading file backed blobs for the non-NETWORK_SESSION
1527         code path of WebKit2, which is still use on pre-Sierra macOS.
1528
1529         * NetworkProcess/Downloads/Download.cpp:
1530         (WebKit::Download::~Download):
1531         * NetworkProcess/Downloads/Download.h:
1532         (WebKit::Download::setBlobFileReferences):
1533         * NetworkProcess/Downloads/DownloadManager.cpp:
1534         (WebKit::DownloadManager::startDownload):
1535         (WebKit::DownloadManager::convertNetworkLoadToDownload):
1536         * NetworkProcess/Downloads/DownloadManager.h:
1537         * NetworkProcess/NetworkResourceLoader.cpp:
1538         (WebKit::NetworkResourceLoader::convertToDownload):
1539
1540 2016-11-09  Chris Dumez  <cdumez@apple.com>
1541
1542         [WK2][NETWORK_SESSION] Add support for downloading file backed blobs
1543         https://bugs.webkit.org/show_bug.cgi?id=164458
1544         <rdar://problem/28905514>
1545
1546         Reviewed by Darin Adler.
1547
1548         Add support for downloading file backed blobs on WebKit2.
1549         It previously wasn't working because we weren't calling
1550         BlobDataFileReference::prepareForFileAccess() for each blob file before
1551         starting the download, similarly to what is done in NetworkResourceLoader's
1552         consumeSandboxExtensions().
1553
1554         * NetworkProcess/Downloads/DownloadManager.cpp:
1555         (WebKit::DownloadManager::startDownload):
1556         * NetworkProcess/Downloads/DownloadManager.h:
1557         (WebKit::DownloadManager::startDownload):
1558         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1559         (WebKit::NetworkConnectionToWebProcess::startDownload):
1560         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
1561         * NetworkProcess/NetworkDataTask.cpp:
1562         (WebKit::NetworkDataTask::create):
1563         * NetworkProcess/NetworkDataTask.h:
1564         * NetworkProcess/NetworkDataTaskBlob.cpp:
1565         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
1566         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
1567         (WebKit::NetworkDataTaskBlob::download):
1568         * NetworkProcess/NetworkDataTaskBlob.h:
1569         * NetworkProcess/NetworkLoad.cpp:
1570         (WebKit::NetworkLoad::NetworkLoad):
1571         * NetworkProcess/NetworkLoadParameters.h:
1572         * NetworkProcess/NetworkProcess.cpp:
1573         (WebKit::NetworkProcess::downloadRequest):
1574         * NetworkProcess/NetworkResourceLoader.cpp:
1575         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
1576         (WebKit::NetworkResourceLoader::startNetworkLoad):
1577         * NetworkProcess/PingLoad.h:
1578
1579 2016-11-09  Carlos Garcia Campos  <cgarcia@igalia.com>
1580
1581         NetworkSession: Network process crash when converting main resource to download
1582         https://bugs.webkit.org/show_bug.cgi?id=164220
1583
1584         Reviewed by Alex Christensen.
1585
1586         Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
1587         sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
1588         NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
1589         download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
1590         NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
1591         having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
1592         load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
1593         NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
1594         client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
1595         created yet. That's not expected to happen and when the response completion handler is called in the
1596         NetworkDataTask it tries to use either the client or the download and it crashes.
1597         We need to cleanup and destroy the ResourceLoader as soon as it becomes a download, because that's the expected
1598         behavior, but at the same time we need to keep the NetworkLoad alive until the NetworkDataTask finishes to become
1599         a download. This patch creates a PendingDownload to take the ownership of the NetworkLoad, so that
1600         ResourceLoader can be cleaned up and destroyed. The DownloadManager now will handle the PendingDownload as if it
1601         was created by startDownload(), but ensuring it's deleted right before the final Download object is added to the
1602         downloads map. That way NetworkDataTask will always have a valid client until the final Download is created,
1603         first the ResourceLoader and then the PendingDownload. Since the DownloadManager is the owner of the
1604         PendingDownload we no longer need the didBecomeDownload() callback to delete the NetworkLoad, because the
1605         NetworkLoad will always be owned by the PendingDownload now that will be deleted by the DownloadManager.
1606
1607         * NetworkProcess/Downloads/DownloadManager.cpp:
1608         (WebKit::DownloadManager::dataTaskBecameDownloadTask): Change the ASSERT because at this point we should always
1609         have a PendingDownload, and then remove it from the map here before adding the final Download to the map.
1610         (WebKit::DownloadManager::convertNetworkLoadToDownload): This replaces convertHandleToDownload, but it also now
1611         used for the NetworkSession. It creates a PendingDownload for the given NetworkLoad.
1612         (WebKit::DownloadManager::continueDecidePendingDownloadDestination): Do not take the PendingDownload from the
1613         map here, just check it's present, because it will be removed from dataTaskBecameDownloadTask().
1614         (WebKit::DownloadManager::convertHandleToDownload): Deleted.
1615         * NetworkProcess/Downloads/DownloadManager.h:
1616         * NetworkProcess/Downloads/PendingDownload.cpp:
1617         (WebKit::PendingDownload::PendingDownload): Add a constructor that receives a NetworkLoad.
1618         * NetworkProcess/Downloads/PendingDownload.h:
1619         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1620         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Just ask the ResourceLoader to be
1621         converted to a download.
1622         * NetworkProcess/NetworkDataTask.h:
1623         * NetworkProcess/NetworkDataTaskBlob.cpp:
1624         (WebKit::NetworkDataTaskBlob::download): Do not call didBecomeDownload() and add an assert to ensure the client
1625         has already been removed right after the final Download object is created.
1626         * NetworkProcess/NetworkLoad.cpp:
1627         (WebKit::NetworkLoad::NetworkLoad): Use a pointer for the client instead of a reference because now we need to
1628         change the client when the load is converted to a download. We don't need to null check the client in any case
1629         because the member is only updated internally and always from a passed reference.
1630         (WebKit::NetworkLoad::sharedDidReceiveResponse):
1631         (WebKit::NetworkLoad::sharedWillSendRedirectedRequest):
1632         (WebKit::NetworkLoad::convertTaskToDownload): This now receives a PendingDownload. It updates the client and no
1633         longer sends DidStart, because the PendingDownload sends it now.
1634         (WebKit::NetworkLoad::didReceiveChallenge):
1635         (WebKit::NetworkLoad::didReceiveData):
1636         (WebKit::NetworkLoad::didCompleteWithError):
1637         (WebKit::NetworkLoad::didSendData):
1638         (WebKit::NetworkLoad::wasBlocked):
1639         (WebKit::NetworkLoad::cannotShowURL):
1640         (WebKit::NetworkLoad::didReceiveBuffer):
1641         (WebKit::NetworkLoad::didFinishLoading):
1642         (WebKit::NetworkLoad::didFail):
1643         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
1644         (WebKit::NetworkLoad::didBecomeDownload): Deleted.
1645         * NetworkProcess/NetworkLoad.h:
1646         * NetworkProcess/NetworkLoadClient.h: Remove didBecomeDownload().
1647         * NetworkProcess/NetworkResourceLoader.cpp:
1648         (WebKit::NetworkResourceLoader::convertToDownload): This replaces didBecomeDownload() and
1649         didConvertToDownload(). It transfers the NetworkLoad to the DownloadManager.
1650         (WebKit::NetworkResourceLoader::abort): We don't need to check if the load was converted to a download here,
1651         because m_networkLoad will always be null here in such case.
1652         (WebKit::NetworkResourceLoader::didBecomeDownload): Deleted
1653         (WebKit::NetworkResourceLoader::didConvertToDownload): Deleted
1654         * NetworkProcess/NetworkResourceLoader.h:
1655         * NetworkProcess/PingLoad.h: Remove didBecomeDownload().
1656         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: Ditto.
1657         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Ditto.
1658         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: Ditto.
1659         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1660         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): Do not call didBecomeDownload().
1661         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1662         (WebKit::NetworkDataTaskSoup::download): Do not call didBecomeDownload() and add an assert to ensure the client
1663         has already been removed right after the final Download object is created.
1664
1665 2016-11-09  Alex Christensen  <achristensen@webkit.org>
1666
1667         Unreviewed, rolling out r208438.
1668
1669         crashes
1670
1671         Reverted changeset:
1672
1673         "[WK2][NETWORK_SESSION] Add support for downloading file
1674         backed blobs"
1675         https://bugs.webkit.org/show_bug.cgi?id=164458
1676         http://trac.webkit.org/changeset/208438
1677
1678 2016-11-04  Brent Fulgham  <bfulgham@apple.com>
1679
1680         Local HTML should be blocked from localStorage access unless "Disable Local File Restrictions" is checked
1681         https://bugs.webkit.org/show_bug.cgi?id=155185
1682         <rdar://problem/11101440>
1683
1684         Reviewed by Brady Eidson.
1685
1686         Provide SPI to access the new quirk for localStorage. The quirk defaults to 'on'. When active, this
1687         quirk says that localStorage access should be granted, without needing to grant universal file access.
1688
1689         If the quirk is turned off, then localStorage is blocked unless the WebKit client explicitly
1690         grants universal file access.
1691         
1692         Tested by existing TestWebKitAPI tests and WebKit2.LocalStorageQuirkTest
1693
1694         * Shared/WebPreferencesDefinitions.h:
1695         * UIProcess/API/C/WKPreferences.cpp:
1696         (WKPreferencesSetNeedsLocalStorageQuirk): Added.
1697         (WKPreferencesGetNeedsLocalStorageQuirk): Added.
1698         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1699         * UIProcess/API/Cocoa/WKWebView.mm:
1700         (-[WKWebView _initializeWithConfiguration:]): Honor the new localStorage quirk.
1701         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1702         (-[WKWebViewConfiguration init]): Honor the new localStorage quirk flag.
1703         (-[WKWebViewConfiguration copyWithZone:]): Ditto.
1704         (-[WKWebViewConfiguration _needsLocalStorageQuirk]): Added.
1705         (-[WKWebViewConfiguration _setNeedsLocalStorageQuirk:]): Added.
1706         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1707         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1708         (WKBundleSetNeedsLocalStorageQuirk): Added.
1709         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1710         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1711         (WebKit::InjectedBundle::setNeedsLocalStorageQuirk): Added.
1712         * WebProcess/InjectedBundle/InjectedBundle.h:
1713         * WebProcess/WebPage/WebPage.cpp:
1714         (WebKit::WebPage::updatePreferences): Honor the new localStorage quirk flag.
1715
1716 2016-11-09  Simon Fraser  <simon.fraser@apple.com>
1717
1718         Implement visual-viewport based position:fixed handling for Mac async scrolling
1719         https://bugs.webkit.org/show_bug.cgi?id=164495
1720
1721         Reviewed by Tim Horton.
1722
1723         Educate the scrolling tree about visual and layout viewports. This is runtime-switchable,
1724         so we push the enable flag to via the root state node, then push the layout viewport,
1725         and the min/max scroll position that contstrain it, through frame state nodes.
1726
1727         When a scroll happens, we compute a new layout viewport when the visual viewport hits
1728         an edge, and push that down through setScrollLayerPosition() since it's used to position
1729         fixed and sticky layers.
1730
1731         The iOS code is made to compile, but not work yet.
1732
1733         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
1734         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
1735         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
1736         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
1737         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
1738         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
1739         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
1740         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
1741         * UIProcess/Scrolling/RemoteScrollingTree.h:
1742         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1743         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1744         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition):
1745         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
1746         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
1747
1748 2016-11-09  Beth Dakin  <bdakin@apple.com>
1749
1750         More attempted build fix.
1751
1752         * UIProcess/Cocoa/WebViewImpl.mm:
1753
1754 2016-11-09  Alex Christensen  <achristensen@webkit.org>
1755
1756         Clean up Storage code
1757         https://bugs.webkit.org/show_bug.cgi?id=164562
1758
1759         Reviewed by Brady Eidson.
1760
1761         Use more Refs!
1762
1763         * NetworkProcess/CustomProtocols/CustomProtocolManager.h:
1764         * Platform/IPC/Connection.cpp:
1765         (IPC::Connection::addWorkQueueMessageReceiver):
1766         * Platform/IPC/Connection.h:
1767         * UIProcess/Storage/LocalStorageDatabase.cpp:
1768         (WebKit::LocalStorageDatabase::create):
1769         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
1770         * UIProcess/Storage/LocalStorageDatabase.h:
1771         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1772         (WebKit::LocalStorageDatabaseTracker::create):
1773         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
1774         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
1775         * UIProcess/Storage/StorageManager.cpp:
1776         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
1777         (WebKit::StorageManager::StorageManager):
1778         * UIProcess/Storage/StorageManager.h:
1779         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1780         (WebKit::WebResourceLoadStatisticsStore::processWillOpenConnection):
1781         * UIProcess/mac/SecItemShimProxy.cpp:
1782         (WebKit::SecItemShimProxy::initializeConnection):
1783         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
1784         (WebKit::PluginProcessConnectionManager::initializeConnection):
1785         * WebProcess/WebPage/EventDispatcher.cpp:
1786         (WebKit::EventDispatcher::initializeConnection):
1787         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
1788         (WebKit::ViewUpdateDispatcher::initializeConnection):
1789
1790 2016-11-09  Beth Dakin  <bdakin@apple.com>
1791
1792         Another attempted build fix.
1793
1794         * UIProcess/Cocoa/WebViewImpl.mm:
1795
1796 2016-11-09  Michael Catanzaro  <mcatanzaro@igalia.com>
1797
1798         Experimental features should not be enabled by default
1799         https://bugs.webkit.org/show_bug.cgi?id=164367
1800
1801         Reviewed by Darin Adler.
1802
1803         We have two classes of experimental features:
1804
1805         (1) Features that are unstable and should be off by default, except for the developers
1806             currently working on them. This is straightforward to handle; the default value should
1807             be false.
1808         (2) Features that are still not ready for end users, but are stable enough for testing. We
1809             want these features to be enabled in testing environments like the bots, MiniBrowser,
1810             Safari Tech Preview, and so forth, but not in stable release builds.
1811
1812         Implement this. It is better than having all experimental features on unconditionally, and
1813         expecting them to be disabled manually on release branches, which is not something we are
1814         keen to do. An exception is Cocoa ports, which to my knowledge do not currently have any
1815         concept of development builds. These ports seem happy to continue disabling features
1816         manually in release branches, and should continue to do so at least for now.
1817
1818         We also have features that we wish to enumerate at runtime, yet have enabled by default
1819         unconditionally. We do not currently have any infrastructure to support this and should not
1820         abuse the experimental status for this purpose; it requires future work. All settings can
1821         still be toggled at runtime by clients that know about them using the existing runtime
1822         features API.
1823
1824         Lastly, the custom elements feature is ready to be enabled by default, so it's no longer
1825         experimental and can graduate to the list of normal boolean features.
1826
1827         * Shared/WebPreferencesDefinitions.h:
1828
1829 2016-11-09  Beth Dakin  <bdakin@apple.com>
1830
1831         Build fix.
1832
1833         * UIProcess/Cocoa/WebViewImpl.mm:
1834
1835 2016-11-09  Brady Eidson  <beidson@apple.com>
1836
1837         IndexedDB 2.0: Encapsulate cursor iteration parameters for easy future expansion.
1838         https://bugs.webkit.org/show_bug.cgi?id=164504
1839
1840         Reviewed by Darin Adler.
1841
1842         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1843         (WebKit::WebIDBConnectionToClient::iterateCursor):
1844         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
1845         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
1846
1847         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1848         (WebKit::WebIDBConnectionToServer::iterateCursor):
1849         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1850
1851 2016-11-09  Darin Adler  <darin@apple.com>
1852
1853         Move Range from ExceptionCode to ExceptionOr
1854         https://bugs.webkit.org/show_bug.cgi?id=164457
1855
1856         Reviewed by Alex Christensen.
1857
1858         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
1859         (webkit_dom_range_set_start): Updated exception handling.
1860         (webkit_dom_range_set_end): Ditto.
1861         (webkit_dom_range_set_start_before): Ditto.
1862         (webkit_dom_range_set_start_after): Ditto.
1863         (webkit_dom_range_set_end_before): Ditto.
1864         (webkit_dom_range_set_end_after): Ditto.
1865         (webkit_dom_range_select_node): Ditto.
1866         (webkit_dom_range_select_node_contents): Ditto.
1867         (webkit_dom_range_compare_boundary_points): Ditto.
1868         (webkit_dom_range_delete_contents): Ditto.
1869         (webkit_dom_range_extract_contents): Ditto.
1870         (webkit_dom_range_clone_contents): Ditto.
1871         (webkit_dom_range_insert_node): Ditto.
1872         (webkit_dom_range_surround_contents): Ditto.
1873         (webkit_dom_range_create_contextual_fragment): Ditto.
1874         (webkit_dom_range_compare_node): Ditto.
1875         (webkit_dom_range_intersects_node): Ditto.
1876         (webkit_dom_range_compare_point): Ditto.
1877         (webkit_dom_range_is_point_in_range): Ditto.
1878         (webkit_dom_range_expand): Ditto.
1879         * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
1880         (-[WKDOMRange setStart:offset:]): Ditto.
1881         (-[WKDOMRange setEnd:offset:]): Ditto.
1882         (-[WKDOMRange selectNode:]): Ditto.
1883         (-[WKDOMRange selectNodeContents:]): Ditto.
1884         * WebProcess/WebPage/WebFrame.cpp:
1885         (WebKit::WebFrame::contentsAsString): Ditto.
1886         * WebProcess/WebPage/ios/WebPageIOS.mm:
1887         (WebKit::WebPage::rangeForWebSelectionAtPosition): Ditto.
1888         (WebKit::WebPage::rangeForBlockAtPoint): Ditto.
1889         (WebKit::WebPage::selectWithGesture): Ditto.
1890         (WebKit::containsRange): Ditto.
1891         (WebKit::unionDOMRanges): Ditto.
1892         (WebKit::WebPage::switchToBlockSelectionAtPoint): Ditto.
1893         (WebKit::WebPage::getPositionInformation): Ditto.
1894
1895
1896 2016-11-09  Darin Adler  <darin@apple.com>
1897
1898         Move EventTarget from ExceptionCode to ExceptionOr
1899         https://bugs.webkit.org/show_bug.cgi?id=164465
1900
1901         Reviewed by Youenn Fablet.
1902
1903         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
1904         (webkit_dom_attr_dispatch_event): Updated exception handling.
1905         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
1906         (webkit_dom_cdata_section_dispatch_event): Ditto.
1907         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
1908         (webkit_dom_character_data_dispatch_event): Ditto.
1909         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
1910         (webkit_dom_comment_dispatch_event): Ditto.
1911         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
1912         (webkit_dom_dom_window_dispatch_event): Ditto.
1913         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
1914         (webkit_dom_document_dispatch_event): Ditto.
1915         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
1916         (webkit_dom_document_fragment_dispatch_event): Ditto.
1917         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
1918         (webkit_dom_document_type_dispatch_event): Ditto.
1919         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
1920         (webkit_dom_element_dispatch_event): Ditto.
1921         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
1922         (webkit_dom_html_anchor_element_dispatch_event): Ditto.
1923         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
1924         (webkit_dom_html_applet_element_dispatch_event): Ditto.
1925         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
1926         (webkit_dom_html_area_element_dispatch_event): Ditto.
1927         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
1928         (webkit_dom_html_br_element_dispatch_event): Ditto.
1929         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
1930         (webkit_dom_html_base_element_dispatch_event): Ditto.
1931         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
1932         (webkit_dom_html_body_element_dispatch_event): Ditto.
1933         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
1934         (webkit_dom_html_button_element_dispatch_event): Ditto.
1935         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
1936         (webkit_dom_html_canvas_element_dispatch_event): Ditto.
1937         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
1938         (webkit_dom_html_d_list_element_dispatch_event): Ditto.
1939         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
1940         (webkit_dom_html_directory_element_dispatch_event): Ditto.
1941         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
1942         (webkit_dom_html_div_element_dispatch_event): Ditto.
1943         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
1944         (webkit_dom_html_document_dispatch_event): Ditto.
1945         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
1946         (webkit_dom_html_element_dispatch_event): Ditto.
1947         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
1948         (webkit_dom_html_embed_element_dispatch_event): Ditto.
1949         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
1950         (webkit_dom_html_field_set_element_dispatch_event): Ditto.
1951         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
1952         (webkit_dom_html_font_element_dispatch_event): Ditto.
1953         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
1954         (webkit_dom_html_form_element_dispatch_event): Ditto.
1955         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
1956         (webkit_dom_html_frame_element_dispatch_event): Ditto.
1957         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
1958         (webkit_dom_html_frame_set_element_dispatch_event): Ditto.
1959         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
1960         (webkit_dom_html_hr_element_dispatch_event): Ditto.
1961         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
1962         (webkit_dom_html_heading_element_dispatch_event): Ditto.
1963         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
1964         (webkit_dom_html_head_element_dispatch_event): Ditto.
1965         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
1966         (webkit_dom_html_html_element_dispatch_event): Ditto.
1967         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
1968         (webkit_dom_html_iframe_element_dispatch_event): Ditto.
1969         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
1970         (webkit_dom_html_image_element_dispatch_event): Ditto.
1971         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
1972         (webkit_dom_html_input_element_dispatch_event): Ditto.
1973         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
1974         (webkit_dom_html_li_element_dispatch_event): Ditto.
1975         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
1976         (webkit_dom_html_label_element_dispatch_event): Ditto.
1977         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
1978         (webkit_dom_html_legend_element_dispatch_event): Ditto.
1979         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
1980         (webkit_dom_html_link_element_dispatch_event): Ditto.
1981         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
1982         (webkit_dom_html_map_element_dispatch_event): Ditto.
1983         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
1984         (webkit_dom_html_marquee_element_dispatch_event): Ditto.
1985         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
1986         (webkit_dom_html_menu_element_dispatch_event): Ditto.
1987         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
1988         (webkit_dom_html_meta_element_dispatch_event): Ditto.
1989         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
1990         (webkit_dom_html_mod_element_dispatch_event): Ditto.
1991         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
1992         (webkit_dom_html_o_list_element_dispatch_event): Ditto.
1993         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
1994         (webkit_dom_html_object_element_dispatch_event): Ditto.
1995         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
1996         (webkit_dom_html_opt_group_element_dispatch_event): Ditto.
1997         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
1998         (webkit_dom_html_option_element_dispatch_event): Ditto.
1999         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
2000         (webkit_dom_html_paragraph_element_dispatch_event): Ditto.
2001         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
2002         (webkit_dom_html_param_element_dispatch_event): Ditto.
2003         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
2004         (webkit_dom_html_pre_element_dispatch_event): Ditto.
2005         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
2006         (webkit_dom_html_quote_element_dispatch_event): Ditto.
2007         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
2008         (webkit_dom_html_script_element_dispatch_event): Ditto.
2009         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
2010         (webkit_dom_html_select_element_dispatch_event): Ditto.
2011         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
2012         (webkit_dom_html_style_element_dispatch_event): Ditto.
2013         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
2014         (webkit_dom_html_table_caption_element_dispatch_event): Ditto.
2015         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
2016         (webkit_dom_html_table_cell_element_dispatch_event): Ditto.
2017         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
2018         (webkit_dom_html_table_col_element_dispatch_event): Ditto.
2019         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
2020         (webkit_dom_html_table_element_dispatch_event): Ditto.
2021         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
2022         (webkit_dom_html_table_row_element_dispatch_event): Ditto.
2023         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
2024         (webkit_dom_html_table_section_element_dispatch_event): Ditto.
2025         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
2026         (webkit_dom_html_text_area_element_dispatch_event): Ditto.
2027         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
2028         (webkit_dom_html_title_element_dispatch_event): Ditto.
2029         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
2030         (webkit_dom_html_u_list_element_dispatch_event): Ditto.
2031         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp:
2032         (webkit_dom_node_dispatch_event): Ditto.
2033         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
2034         (webkit_dom_processing_instruction_dispatch_event): Ditto.
2035         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
2036         (webkit_dom_text_dispatch_event): Ditto.
2037
2038 2016-11-08  Dean Jackson  <dino@apple.com>
2039
2040         Rendering support for ExtendedColors
2041         https://bugs.webkit.org/show_bug.cgi?id=164443
2042         <rdar://problems/29123243>
2043
2044         Reviewed by Simon Fraser and Darin Adler.
2045
2046         Implement argument coders for Color.
2047
2048         * Shared/WebCoreArgumentCoders.cpp:
2049         (IPC::ArgumentCoder<Color>::encode):
2050         (IPC::ArgumentCoder<Color>::decode):
2051         * Shared/WebCoreArgumentCoders.h:
2052         * UIProcess/API/Cocoa/WKWebView.mm:
2053         (-[WKWebView _updateScrollViewBackground]):
2054
2055 2016-11-09  Beth Dakin  <bdakin@apple.com>
2056
2057         Build fix.
2058
2059         * UIProcess/Cocoa/WebViewImpl.mm:
2060         (WebKit::WebViewImpl::~WebViewImpl):
2061
2062 2016-11-09  Chris Dumez  <cdumez@apple.com>
2063
2064         [Mac] Stop using deprecated AppKit enumeration values
2065         https://bugs.webkit.org/show_bug.cgi?id=164494
2066
2067         Reviewed by Darin Adler.
2068
2069         Stop using deprecated AppKit enumeration values.
2070
2071         * Shared/mac/ChildProcessMac.mm:
2072         (WebKit::ChildProcess::stopNSAppRunLoop):
2073         * Shared/mac/WebEventFactory.mm:
2074         (WebKit::mouseButtonForEvent):
2075         (WebKit::mouseEventTypeForEvent):
2076         (WebKit::clickCountForEvent):
2077         (WebKit::globalPointForEvent):
2078         (WebKit::pointForEvent):
2079         (WebKit::textFromEvent):
2080         (WebKit::unmodifiedTextFromEvent):
2081         (WebKit::isKeypadEvent):
2082         (WebKit::isKeyUpEvent):
2083         (WebKit::WebEventFactory::createWebKeyboardEvent):
2084         * UIProcess/Cocoa/WebViewImpl.mm:
2085         (WebKit::WebViewImpl::becomeFirstResponder):
2086         (WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
2087         (WebKit::WebViewImpl::viewDidMoveToWindow):
2088         (WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent):
2089         (WebKit::WebViewImpl::createFullScreenWindow):
2090         (WebKit::WebViewImpl::sendToolTipMouseExited):
2091         (WebKit::WebViewImpl::sendToolTipMouseEntered):
2092         (WebKit::applicationFlagsForDrag):
2093         (WebKit::WebViewImpl::setLastMouseDownEvent):
2094         (WebKit::WebViewImpl::doneWithKeyEvent):
2095         (WebKit::WebViewImpl::collectKeyboardLayoutCommandsForEvent):
2096         (WebKit::WebViewImpl::performKeyEquivalent):
2097         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2098         (WebKit::PluginProcessProxy::beginModal):
2099         * UIProcess/mac/WebContextMenuProxyMac.mm:
2100         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
2101         * UIProcess/mac/WebInspectorProxyMac.mm:
2102         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2103         (WebKit::WebPopupMenuProxyMac::populate):
2104         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
2105         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
2106         (WebKit::modifierFlagsFromWebEvent):
2107         (WebKit::getEventTypeFromWebEvent):
2108         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
2109         (WebKit::cssAlignmentValueForNSTextAlignment):
2110         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2111         (WebKit::convertImageToBitmap):
2112
2113 2016-11-09  Beth Dakin  <bdakin@apple.com>
2114
2115         Support TouchBar in WebKit
2116         https://bugs.webkit.org/show_bug.cgi?id=164437
2117         -and corresponding-
2118         rdar://problem/28876524
2119
2120         Reviewed by Darin Adler.
2121
2122         * UIProcess/API/Cocoa/WKViewPrivate.h:
2123         * UIProcess/API/Cocoa/WKWebView.mm:
2124         (-[WKWebView makeTouchBar]):
2125         (-[WKWebView candidateListTouchBarItem]):
2126         (-[WKWebView _web_didAddMediaControlsManager:]):
2127         (-[WKWebView _web_didRemoveMediaControlsManager]):
2128         (-[WKWebView _interactWithMediaControlsForTesting]):
2129         (-[WKWebView _wantsMediaPlaybackControlsView]):
2130         (-[WKWebView _setWantsMediaPlaybackControlsView:]):
2131         (-[WKWebView _mediaPlaybackControlsView]):
2132         (-[WKWebView _addMediaPlaybackControlsView:]):
2133         (-[WKWebView _removeMediaPlaybackControlsView]):
2134         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2135         * UIProcess/API/mac/WKView.mm:
2136         (-[WKView makeTouchBar]):
2137         (-[WKView candidateListTouchBarItem]):
2138         (-[WKView _web_didAddMediaControlsManager:]):
2139         (-[WKView _web_didRemoveMediaControlsManager]):
2140         (-[WKView _wantsMediaPlaybackControlsView]):
2141         (-[WKView _setWantsMediaPlaybackControlsView:]):
2142         (-[WKView _mediaPlaybackControlsView]):
2143         (-[WKView _addMediaPlaybackControlsView:]):
2144         (-[WKView _removeMediaPlaybackControlsView]):
2145         * UIProcess/Cocoa/WebViewImpl.h:
2146         (WebKit::WebViewImpl::currentTouchBar):
2147         (WebKit::WebViewImpl::clientWantsMediaPlaybackControlsView):
2148         (WebKit::WebViewImpl::setClientWantsMediaPlaybackControlsView):
2149         (WebKit::WebViewImpl::setIsCustomizingTouchBar):
2150         * UIProcess/Cocoa/WebViewImpl.mm:
2151         (-[WKTextListTouchBarViewController initWithWebViewImpl:]):
2152         (-[WKTextListTouchBarViewController didDestroyView]):
2153         (-[WKTextListTouchBarViewController _selectList:]):
2154         (-[WKTextListTouchBarViewController setCurrentListType:]):
2155         (-[WKTextTouchBarItemController initWithWebViewImpl:]):
2156         (-[WKTextTouchBarItemController didDestroyView]):
2157         (-[WKTextTouchBarItemController touchBar:makeItemForIdentifier:]):
2158         (-[WKTextTouchBarItemController itemForIdentifier:]):
2159         (-[WKTextTouchBarItemController candidateListTouchBarItem:endSelectingCandidateAtIndex:]):
2160         (-[WKTextTouchBarItemController candidateListTouchBarItem:changedCandidateListVisibility:]):
2161         (-[WKTextTouchBarItemController textListTouchBarViewController]):
2162         (-[WKTextTouchBarItemController setTextIsBold:]):
2163         (-[WKTextTouchBarItemController setTextIsItalic:]):
2164         (-[WKTextTouchBarItemController setTextIsUnderlined:]):
2165         (-[WKTextTouchBarItemController _wkChangeTextStyle:]):
2166         (-[WKTextTouchBarItemController setCurrentTextAlignment:]):
2167         (-[WKTextTouchBarItemController _wkChangeTextAlignment:]):
2168         (-[WKTextTouchBarItemController textColor]):
2169         (-[WKTextTouchBarItemController setTextColor:]):
2170         (-[WKTextTouchBarItemController _wkChangeColor:]):
2171         (-[WKTextTouchBarItemController textListViewController]):
2172         (WebKit::WebViewImpl::makeTouchBar):
2173         (WebKit::WebViewImpl::candidateListTouchBarItem):
2174         (WebKit::WebViewImpl::mediaPlaybackControlsView):
2175         (WebKit::WebViewImpl::useMediaPlaybackControlsView):
2176         (WebKit::WebViewImpl::dismissTextTouchBarPopoverItemWithIdentifier):
2177         (WebKit::textTouchBarCustomizationAllowedIdentifiers):
2178         (WebKit::plainTextTouchBarCustomizationDefaultItemIdentifiers):
2179         (WebKit::richTextTouchBarCustomizationDefaultItemIdentifiers):
2180         (WebKit::touchBarDidExitCustomization):
2181         (WebKit::touchBarWillEnterCustomization):
2182         (WebKit::didChangeAutomaticTextCompletion):
2183         (WebKit::WebViewImpl::updateTouchBarAndRefreshTextBarIdentifiers):
2184         (WebKit::WebViewImpl::setUpTextTouchBar):
2185         (WebKit::WebViewImpl::isRichlyEditable):
2186         (WebKit::WebViewImpl::textTouchBar):
2187         (WebKit::WebViewImpl::updateTextTouchBar):
2188         (WebKit::WebViewImpl::updateMediaTouchBar):
2189         (WebKit::WebViewImpl::forceRequestCandidatesForTesting):
2190         (WebKit::WebViewImpl::updateTouchBar):
2191         (WebKit::WebViewImpl::shouldRequestCandidates):
2192         (WebKit::WebViewImpl::showCandidates):
2193         (WebKit::WebViewImpl::webViewImplAdditionsWillDestroyView):
2194         (WebKit::WebViewImpl::setEditableElementIsFocused):
2195         (WebKit::WebViewImpl::becomeFirstResponder):
2196         (WebKit::WebViewImpl::selectionDidChange):
2197         (WebKit::WebViewImpl::videoControlsManagerDidChange):
2198         (WebKit::WebViewImpl::updateWebViewImplAdditions): Deleted.
2199
2200 2016-11-09  Chris Dumez  <cdumez@apple.com>
2201
2202         [WK2][NETWORK_SESSION] Add support for downloading file backed blobs
2203         https://bugs.webkit.org/show_bug.cgi?id=164458
2204         <rdar://problem/28905514>
2205
2206         Reviewed by Darin Adler.
2207
2208         Add support for downloading file backed blobs on WebKit2.
2209         It previously wasn't working because we weren't calling
2210         BlobDataFileReference::prepareForFileAccess() for each blob file before
2211         starting the download, similarly to what is done in NetworkResourceLoader's
2212         consumeSandboxExtensions().
2213
2214         * NetworkProcess/Downloads/DownloadManager.cpp:
2215         (WebKit::DownloadManager::startDownload):
2216         * NetworkProcess/Downloads/DownloadManager.h:
2217         (WebKit::DownloadManager::startDownload):
2218         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2219         (WebKit::NetworkConnectionToWebProcess::startDownload):
2220         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
2221         * NetworkProcess/NetworkDataTask.cpp:
2222         (WebKit::NetworkDataTask::create):
2223         * NetworkProcess/NetworkDataTask.h:
2224         * NetworkProcess/NetworkDataTaskBlob.cpp:
2225         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
2226         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
2227         (WebKit::NetworkDataTaskBlob::download):
2228         * NetworkProcess/NetworkDataTaskBlob.h:
2229         * NetworkProcess/NetworkLoad.cpp:
2230         (WebKit::NetworkLoad::NetworkLoad):
2231         * NetworkProcess/NetworkLoadParameters.h:
2232         * NetworkProcess/NetworkProcess.cpp:
2233         (WebKit::NetworkProcess::downloadRequest):
2234         * NetworkProcess/NetworkResourceLoader.cpp:
2235         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
2236         (WebKit::NetworkResourceLoader::startNetworkLoad):
2237         * NetworkProcess/PingLoad.h:
2238
2239 2016-11-09  Chris Dumez  <cdumez@apple.com>
2240
2241         [WK2] Network cache speculative revalidation can cause loads to hang
2242         https://bugs.webkit.org/show_bug.cgi?id=164532
2243         <rdar://problem/28519331>
2244
2245         Reviewed by Alex Christensen.
2246
2247         Network cache speculative revalidation could cause loads to hang when HTTP
2248         authentication was involved because NetworkCacheSpeculativeLoad failed to
2249         call NetworkLoad::continueCanAuthenticateAgainstProtectionSpace() in its
2250         canAuthenticateAgainstProtectionSpaceAsync() callback.
2251
2252         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2253         (WebKit::NetworkCache::SpeculativeLoad::canAuthenticateAgainstProtectionSpaceAsync):
2254         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
2255
2256 2016-11-09  Csaba Osztrogonác  <ossy@webkit.org>
2257
2258         URTBF after r208361.
2259
2260         * PlatformMac.cmake:
2261
2262 2016-11-09  Csaba Osztrogonác  <ossy@webkit.org>
2263
2264         Unreviewed typo fix after r160616 to fix the build on case sensitive file systems.
2265
2266         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2267
2268 2016-11-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2269
2270         [SOUP] Layout test http/tests/misc/authentication-redirect-3/authentication-sent-to-redirect-same-origin-with-location-credentials.html fails
2271         https://bugs.webkit.org/show_bug.cgi?id=139358
2272
2273         Reviewed by Michael Catanzaro.
2274
2275         Stop putting the credentials in the URL unconditionally and ensure we only do that when provided by the URL
2276         itself. Libsoup has its own cache of SoupAuth, so we don't need to pass user/pass in the URL for every single
2277         request, libsoup will authenticate those automatically.
2278
2279         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2280         (WebKit::NetworkDataTaskSoup::applyAuthenticationToRequest):
2281
2282 2016-11-04  Filip Pizlo  <fpizlo@apple.com>
2283
2284         WTF::ParkingLot should stop using std::chrono because std::chrono::duration casts are prone to overflows
2285         https://bugs.webkit.org/show_bug.cgi?id=152045
2286
2287         Reviewed by Andy Estes.
2288
2289         * Platform/IPC/Connection.cpp:
2290         (IPC::Connection::SyncMessageState::wait):
2291         (IPC::Connection::sendMessage):
2292         (IPC::Connection::timeoutRespectingIgnoreTimeoutsForTesting):
2293         (IPC::Connection::waitForMessage):
2294         (IPC::Connection::sendSyncMessage):
2295         (IPC::Connection::waitForSyncReply):
2296         * Platform/IPC/Connection.h:
2297         (IPC::Connection::sendSync):
2298         (IPC::Connection::waitForAndDispatchImmediately):
2299         * Platform/IPC/MessageSender.h:
2300         (IPC::MessageSender::sendSync):
2301         * UIProcess/ChildProcessProxy.h:
2302         (WebKit::ChildProcessProxy::sendSync):
2303         * UIProcess/Network/NetworkProcessProxy.cpp:
2304         (WebKit::NetworkProcessProxy::sendProcessWillSuspendImminently):
2305         * UIProcess/Storage/StorageManager.cpp:
2306         (WebKit::StorageManager::applicationWillTerminate):
2307         * UIProcess/WebProcessProxy.cpp:
2308         (WebKit::WebProcessProxy::sendProcessWillSuspendImminently):
2309         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2310         (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
2311         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2312         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2313         (-[WKOneShotDisplayLinkHandler displayLinkFired:]):
2314         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2315         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
2316         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
2317         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2318         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
2319         * UIProcess/mac/WKImmediateActionController.mm:
2320         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
2321         * UIProcess/mac/WebPageProxyMac.mm:
2322         (WebKit::WebPageProxy::stringSelectionForPasteboard):
2323         (WebKit::WebPageProxy::dataSelectionForPasteboard):
2324         (WebKit::WebPageProxy::readSelectionFromPasteboard):
2325         (WebKit::WebPageProxy::shouldDelayWindowOrderingForEvent):
2326         (WebKit::WebPageProxy::acceptsFirstMouse):
2327         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2328         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
2329         (WebKit::WebChromeClient::runJavaScriptAlert):
2330         (WebKit::WebChromeClient::runJavaScriptConfirm):
2331         (WebKit::WebChromeClient::runJavaScriptPrompt):
2332         (WebKit::WebChromeClient::print):
2333         (WebKit::WebChromeClient::exceededDatabaseQuota):
2334         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
2335         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2336         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2337         * WebProcess/WebPage/WebPage.cpp:
2338         (WebKit::WebPage::postSynchronousMessageForTesting):
2339
2340 2016-11-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2341
2342         Safari does not emit composition end if blurred for dead key / Japanese IME
2343         https://bugs.webkit.org/show_bug.cgi?id=164369
2344         <rdar://problem/29050439>
2345
2346         Reviewed by Ryosuke Niwa.
2347
2348         Split WebPage::discardedComposition into two steps, where we first discard marked text and then update the
2349         editor state. This allows the codepath where we cancel the composition early (before setting the selection) to
2350         discard marked text without also forcing an editor state update at the same time. The editor state is later
2351         updated in WebPage::didChangeSelection.
2352
2353         * UIProcess/WebPageProxy.cpp:
2354         (WebKit::WebPageProxy::compositionWasCanceled):
2355         * UIProcess/WebPageProxy.h:
2356         * UIProcess/WebPageProxy.messages.in:
2357         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2358         (WebKit::WebEditorClient::canceledComposition):
2359         * WebProcess/WebCoreSupport/WebEditorClient.h:
2360         * WebProcess/WebPage/WebPage.cpp:
2361         (WebKit::WebPage::didChangeSelection):
2362         (WebKit::WebPage::discardedComposition):
2363         (WebKit::WebPage::canceledComposition):
2364         * WebProcess/WebPage/WebPage.h:
2365
2366 2016-11-04  Alex Christensen  <achristensen@webkit.org>
2367
2368         Unreviewed, rolling out r208293.
2369
2370         asserts in API tests.
2371
2372         Reverted changeset:
2373
2374         "NetworkSession: Network process crash when converting main
2375         resource to download"
2376         https://bugs.webkit.org/show_bug.cgi?id=164220
2377         http://trac.webkit.org/changeset/208293
2378
2379 2016-11-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
2380
2381         Add a setting and preferences to enable/disable async image decoding
2382         https://bugs.webkit.org/show_bug.cgi?id=164417
2383
2384         Reviewed by Simon Fraser.
2385
2386         Hook up the asyncImageDecodingEnabled setting for WebKit2.
2387
2388         * Shared/WebPreferencesDefinitions.h:
2389         * UIProcess/API/Cocoa/WKPreferences.mm:
2390         (-[WKPreferences _asyncImageDecodingEnabled]):
2391         (-[WKPreferences _setAsyncImageDecodingEnabled:]):
2392         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2393         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2394         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2395         * WebProcess/WebPage/WebPage.cpp:
2396         (WebKit::WebPage::updatePreferences):
2397
2398 2016-11-04  Simon Fraser  <simon.fraser@apple.com>
2399
2400         Rename some ScrollingTree/Node-related functions to reduce the number of uses of "update"
2401         https://bugs.webkit.org/show_bug.cgi?id=164420
2402
2403         Reviewed by Tim Horton.
2404
2405         Rename:
2406             commitNewTreeState -> commitTreeState ("new" was redundant)
2407             updateBeforeChildren -> commitStateBeforeChildren
2408             updateAfterChildren -> commitStateAfterChildren
2409
2410
2411         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
2412         (WebKit::RemoteScrollingCoordinatorProxy::commitScrollingTreeState):
2413         (WebKit::RemoteScrollingCoordinatorProxy::updateScrollingTree): Deleted.
2414         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
2415         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2416         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2417         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren):
2418         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
2419         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateBeforeChildren): Deleted.
2420         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren): Deleted.
2421         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2422         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2423
2424 2016-11-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2425
2426         NetworkSession: Add NetworkDataTask implementation for blobs
2427         https://bugs.webkit.org/show_bug.cgi?id=163939
2428
2429         Reviewed by Alex Christensen.
2430
2431         Add NetworkDataTaskBlob to handle blobs when using NetworkSession instead of using ResourceHandle. This patch
2432         adds more USE(NETWORK_SESSION) ifdefs to not use ResourceHandle in Downloads and NetworkLoad when NetworkSession
2433         is enabled.
2434
2435         * CMakeLists.txt: Add new files to compilation.
2436         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
2437         * NetworkProcess/Downloads/BlobDownloadClient.h:
2438         * NetworkProcess/Downloads/Download.cpp:
2439         (WebKit::Download::Download): Split the constructor again and remove the PlatformDownloadTaskRef
2440         definitions. Now Cocoa specific constructor receives a NSURLSessionDownloadTask and the general constructor
2441         reveices a NetworkDataTask and is used by Soup backend and blobs.
2442         (WebKit::Download::~Download):
2443         (WebKit::Download::start):
2444         (WebKit::Download::startWithHandle):
2445         (WebKit::Download::cancel):
2446         (WebKit::Download::didReceiveAuthenticationChallenge):
2447         (WebKit::Download::didReceiveData):
2448         (WebKit::Download::didFinish):
2449         (WebKit::Download::platformCancelNetworkLoad): Rename cancelNetworkLoad() as platformCancelNetworkLoad() since
2450         this is now used only by Cocoa platform to cancel the NSURLSessionDownloadTask.
2451         * NetworkProcess/Downloads/Download.h:
2452         (WebKit::Download::Download):
2453         (WebKit::Download::suggestedName):
2454         (WebKit::Download::request):
2455         * NetworkProcess/Downloads/DownloadManager.cpp:
2456         (WebKit::DownloadManager::startDownload): Remove blobs specific code when using NetworkSession.
2457         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
2458         * NetworkProcess/Downloads/DownloadManager.h:
2459         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
2460         (WebKit::Download::platformCancelNetworkLoad):
2461         * NetworkProcess/Downloads/soup/DownloadSoup.cpp: Removed.
2462         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2463         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Remove blobs specific code when
2464         using NetworkSession.
2465         * NetworkProcess/NetworkDataTask.cpp:
2466         (WebKit::NetworkDataTask::create): If request is a blob, create a NetworkDataTaskBlob.
2467         * NetworkProcess/NetworkDataTask.h: Add invalidateAndCancel pure virtual method.
2468         * NetworkProcess/NetworkDataTaskBlob.cpp: Added.
2469         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
2470         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
2471         (WebKit::NetworkDataTaskBlob::clearStream):
2472         (WebKit::NetworkDataTaskBlob::resume):
2473         (WebKit::NetworkDataTaskBlob::suspend):
2474         (WebKit::NetworkDataTaskBlob::cancel):
2475         (WebKit::NetworkDataTaskBlob::invalidateAndCancel):
2476         (WebKit::NetworkDataTaskBlob::getSizeForNext):
2477         (WebKit::NetworkDataTaskBlob::didGetSize):
2478         (WebKit::NetworkDataTaskBlob::seek):
2479         (WebKit::NetworkDataTaskBlob::didReceiveResponse):
2480         (WebKit::NetworkDataTaskBlob::read):
2481         (WebKit::NetworkDataTaskBlob::readData):
2482         (WebKit::NetworkDataTaskBlob::readFile):
2483         (WebKit::NetworkDataTaskBlob::didOpen):
2484         (WebKit::NetworkDataTaskBlob::didRead):
2485         (WebKit::NetworkDataTaskBlob::consumeData):
2486         (WebKit::NetworkDataTaskBlob::setPendingDownloadLocation):
2487         (WebKit::NetworkDataTaskBlob::suggestedFilename):
2488         (WebKit::NetworkDataTaskBlob::download):
2489         (WebKit::NetworkDataTaskBlob::writeDownload):
2490         (WebKit::NetworkDataTaskBlob::cleanDownloadFiles):
2491         (WebKit::NetworkDataTaskBlob::didFailDownload):
2492         (WebKit::NetworkDataTaskBlob::didFinishDownload):
2493         (WebKit::NetworkDataTaskBlob::didFail):
2494         (WebKit::NetworkDataTaskBlob::didFinish):
2495         * NetworkProcess/NetworkDataTaskBlob.h: Added.
2496         * NetworkProcess/NetworkLoad.cpp:
2497         (WebKit::NetworkLoad::NetworkLoad): Remove blobs specific code when using NetworkSession.
2498         (WebKit::NetworkLoad::~NetworkLoad):
2499         (WebKit::NetworkLoad::setDefersLoading):
2500         (WebKit::NetworkLoad::cancel):
2501         (WebKit::NetworkLoad::continueWillSendRequest):
2502         (WebKit::NetworkLoad::continueDidReceiveResponse):
2503         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
2504         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
2505         * NetworkProcess/NetworkLoad.h:
2506         * NetworkProcess/NetworkSession.cpp:
2507         (WebKit::NetworkSession::invalidateAndCancel): Moved from NetworkSessionSoup, since this is now used also by blobs.
2508         * NetworkProcess/NetworkSession.h:
2509         (WebKit::NetworkSession::registerNetworkDataTask): Ditto.
2510         (WebKit::NetworkSession::unregisterNetworkDataTask): Ditto.
2511         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Add invalidateAndCancel() implementation that does nothing
2512         because in Cocoa all tasks are invalidated and canceled by the network session.
2513         * NetworkProcess/mac/NetworkLoadMac.mm:
2514         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2515         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
2516         (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
2517         (WebKit::NetworkDataTaskSoup::download):
2518         * NetworkProcess/soup/NetworkDataTaskSoup.h:
2519         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2520         * NetworkProcess/soup/NetworkSessionSoup.h:
2521         * PlatformEfl.cmake: Remove DownloadSoup.cpp from compilation.
2522         * PlatformGTK.cmake: Ditto.
2523         * WebKit2.xcodeproj/project.pbxproj: Add new files to compilation.
2524
2525 2016-11-03  Simon Fraser  <simon.fraser@apple.com>
2526
2527         Give all the geometry classes a single-argument scale() function for consistency
2528         https://bugs.webkit.org/show_bug.cgi?id=164400
2529
2530         Reviewed by Zalan Bujtas.
2531         
2532         Use single-argument scale() functions.
2533
2534         * PluginProcess/PluginControllerProxy.cpp:
2535         (WebKit::PluginControllerProxy::paint):
2536         * Shared/mac/RemoteLayerBackingStore.mm:
2537         (WebKit::RemoteLayerBackingStore::drawInContext):
2538         * UIProcess/API/Cocoa/WKWebView.mm:
2539         (-[WKWebView _didCommitLayerTree:]):
2540         (-[WKWebView _takeViewSnapshot]):
2541         (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
2542         (-[WKWebView _scrollByContentOffset:]):
2543         (-[WKWebView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
2544         * UIProcess/ios/WKContentView.mm:
2545         (-[WKContentView _didCommitLayerTree:]):
2546         * UIProcess/ios/WKContentViewInteraction.mm:
2547         (-[WKContentView _updateTapHighlight]):
2548         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2549         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
2550         (WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
2551         * UIProcess/mac/ViewGestureControllerMac.mm:
2552         (WebKit::ViewGestureController::scaledMagnificationOrigin):
2553         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
2554         (WebKit::InjectedBundleRangeHandle::renderedImage):
2555         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2556         (WebKit::NetscapePlugin::snapshot):
2557         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2558         (WebKit::PDFPlugin::scrollToPoint):
2559         * WebProcess/WebPage/WebFrame.cpp:
2560         (WebKit::WebFrame::createSelectionSnapshot):
2561         * WebProcess/WebPage/WebPage.cpp:
2562         (WebKit::WebPage::scalePageInViewCoordinates):
2563         (WebKit::WebPage::scaleView):
2564         (WebKit::WebPage::snapshotAtSize):
2565         (WebKit::WebPage::snapshotNode):
2566         (WebKit::WebPage::drawRectToImage):
2567         * WebProcess/WebPage/ios/WebPageIOS.mm:
2568         (WebKit::WebPage::restorePageState):
2569
2570 2016-11-03  Chris Dumez  <cdumez@apple.com>
2571
2572         [WK2][Cocoa] Implement user interface for HTML form validation
2573         https://bugs.webkit.org/show_bug.cgi?id=164143
2574         <rdar://problem/28944652>
2575
2576         Reviewed by Simon Fraser.
2577
2578         Implement the ValidationMessageClient in WebKit2 and have it display
2579         a ValidationBubble on Cocoa. ValidationBubble is implemented using
2580         native popovers on both Mac and iOS. As a result, Mac and iOS WK2
2581         now use native popover for HTML form validation instead of the old
2582         Shadow DOM based UI in WebCore.
2583
2584         The native popover shows at the bottom (or top) of the input and it
2585         disapears as soon as the user starts typing or interacts with the
2586         view (e.g. tap / scroll / zoom).
2587
2588         The feature is still disabled at runtime.
2589
2590         * UIProcess/API/Cocoa/WKWebView.mm:
2591         (-[WKWebView _initializeWithConfiguration:]):
2592         (-[WKWebView _keyboardWillShow:]):
2593         (-[WKWebView _keyboardDidShow:]):
2594         (-[WKWebView _contentsOfUserInterfaceItem:]):
2595         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2596         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2597         * UIProcess/PageClient.h:
2598         * UIProcess/WebPageProxy.cpp:
2599         (WebKit::WebPageProxy::handleWheelEvent):
2600         (WebKit::WebPageProxy::setPageZoomFactor):
2601         (WebKit::WebPageProxy::setPageAndTextZoomFactors):
2602         (WebKit::WebPageProxy::pageDidScroll):
2603         (WebKit::WebPageProxy::resetState):
2604         (WebKit::WebPageProxy::hideValidationMessage):
2605         * UIProcess/WebPageProxy.h:
2606         (WebKit::WebPageProxy::validationBubble):
2607         (WebKit::WebPageProxy::setIsKeyboardAnimatingIn):
2608         * UIProcess/WebPageProxy.messages.in:
2609         * UIProcess/ios/PageClientImplIOS.h:
2610         * UIProcess/ios/PageClientImplIOS.mm:
2611         (WebKit::PageClientImpl::createValidationBubble):
2612         * UIProcess/ios/WKContentViewInteraction.mm:
2613         (-[WKContentView _willStartScrollingOrZooming]):
2614         (-[WKContentView scrollViewWillStartPanOrPinchGesture]):
2615         (-[WKContentView _didEndScrollingOrZooming]):
2616         * UIProcess/ios/WebPageProxyIOS.mm:
2617         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
2618         (WebKit::WebPageProxy::potentialTapAtPosition):
2619         (WebKit::WebPageProxy::showValidationMessage):
2620         (WebKit::WebPageProxy::setIsScrollingOrZooming):
2621         * UIProcess/mac/PageClientImpl.h:
2622         * UIProcess/mac/PageClientImpl.mm:
2623         (WebKit::PageClientImpl::createValidationBubble):
2624         * UIProcess/mac/WebPageProxyMac.mm:
2625         (WebKit::WebPageProxy::showValidationMessage):
2626         * WebKit2.xcodeproj/project.pbxproj:
2627         * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
2628         (WebKit::WebValidationMessageClient::WebValidationMessageClient):
2629         (WebKit::WebValidationMessageClient::~WebValidationMessageClient):
2630         (WebKit::WebValidationMessageClient::showValidationMessage):
2631         (WebKit::WebValidationMessageClient::hideValidationMessage):
2632         (WebKit::WebValidationMessageClient::isValidationMessageVisible):
2633         * WebProcess/WebCoreSupport/WebValidationMessageClient.h: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
2634         * WebProcess/WebPage/WebPage.cpp:
2635         (WebKit::m_userInterfaceLayoutDirection):
2636
2637 2016-11-03  Tim Horton  <timothy_horton@apple.com>
2638
2639         Printing to PDF should produce internal links when HTML has internal links
2640         https://bugs.webkit.org/show_bug.cgi?id=112081
2641         <rdar://problem/5955705>
2642
2643         Reviewed by Simon Fraser.
2644
2645         * UIProcess/mac/WKPrintingView.h:
2646         * UIProcess/mac/WKPrintingView.mm:
2647         (linkDestinationName):
2648         (-[WKPrintingView _drawPDFDocument:page:atPoint:]):
2649         Propagate link-to-destination annotations (and each page's destinations)
2650         into the printed PDF.
2651         Generate a unique destination name based on the page and position, because
2652         we have lost the fragment name information.
2653
2654         (-[WKPrintingView drawRect:]):
2655         Compute all of the destinations for every page, so that we can add them
2656         to the context as we paint the pages (we need the page CTM in order to add them).
2657
2658 2016-11-03  Alex Christensen  <achristensen@webkit.org>
2659
2660         Unreviewed, rolling out r208298.
2661         https://bugs.webkit.org/show_bug.cgi?id=163939
2662
2663         caused asan crashes
2664
2665         Reverted changeset:
2666
2667         "NetworkSession: Add NetworkDataTask implementation for blobs"
2668         https://bugs.webkit.org/show_bug.cgi?id=163939
2669         http://trac.webkit.org/changeset/208298
2670
2671 2016-11-03  Ryan Haddad  <ryanhaddad@apple.com>
2672
2673         Unreviewed, rolling out r208330.
2674
2675         This change appears to have caused two editing tests to fail
2676         on macOS.
2677
2678         Reverted changeset:
2679
2680         "Reduce PassRefPtr use in WebKit2"
2681         https://bugs.webkit.org/show_bug.cgi?id=164360
2682         http://trac.webkit.org/changeset/208330
2683
2684 2016-11-03  Dan Bernstein  <mitz@apple.com>
2685
2686         WKWebView’s _observedRenderingProgressEvents not restored after web process crash
2687         https://bugs.webkit.org/show_bug.cgi?id=164368
2688         <rdar://problem/29091954>
2689
2690         Reviewed by Anders Carlsson.
2691
2692         Test: TestWebKitAPI/Tests/WebKit2Cocoa/ObservedRenderingProgressEventsAfterCrash.mm.
2693
2694         * Shared/WebPageCreationParameters.cpp:
2695         (WebKit::WebPageCreationParameters::encode): Encode new observedLayoutMilestones member.
2696         (WebKit::WebPageCreationParameters::decode): Decode it.
2697         * Shared/WebPageCreationParameters.h: Declared new observedLayoutMilestones member variable.
2698
2699         * UIProcess/WebPageProxy.cpp:
2700         (WebKit::WebPageProxy::WebPageProxy): Removed initializer for
2701           m_wantsSessionRestorationRenderTreeSizeThresholdEvent.
2702         (WebKit::WebPageProxy::listenForLayoutMilestones): Update new m_observedLayoutMilestones
2703           member variable. Don’t update m_wantsSessionRestorationRenderTreeSizeThresholdEvent.
2704         (WebKit::WebPageProxy::creationParameters): Set the observedLayoutMilestones member in the
2705           creation parameters.
2706
2707         * UIProcess/WebPageProxy.h: Declared new member variable, deleted
2708           m_wantsSessionRestorationRenderTreeSizeThresholdEvent declaration.
2709
2710         * UIProcess/ios/WebPageProxyIOS.mm:
2711         (WebKit::WebPageProxy::didCommitLayerTree): Rather than using
2712           m_wantsSessionRestorationRenderTreeSizeThresholdEvent, use m_observedLayoutMilestones.
2713
2714         * WebProcess/WebPage/WebPage.cpp:
2715         (WebKit::WebPage::WebPage): Add the observed layout milestones from the creation parameters.
2716
2717 2016-11-02  Alex Christensen  <achristensen@webkit.org>
2718
2719         Reduce PassRefPtr use in WebKit2
2720         https://bugs.webkit.org/show_bug.cgi?id=164360
2721
2722         Reviewed by Tim Horton.
2723
2724         * Shared/API/APISecurityOrigin.h:
2725         (API::SecurityOrigin::SecurityOrigin):
2726         * Shared/API/APISerializedScriptValue.h:
2727         (API::SerializedScriptValue::create):
2728         (API::SerializedScriptValue::SerializedScriptValue):
2729         * Shared/API/c/WKSharedAPICast.h:
2730         (WebKit::ProxyingRefPtr::ProxyingRefPtr):
2731         (WebKit::toAPI):
2732         * Shared/APIWebArchive.h:
2733         * Shared/APIWebArchive.mm:
2734         (API::WebArchive::create):
2735         (API::WebArchive::WebArchive):
2736         * UIProcess/API/APIHitTestResult.cpp:
2737         (API::HitTestResult::create):
2738         * UIProcess/API/APIHitTestResult.h:
2739         * UIProcess/API/APIUIClient.h:
2740         (API::UIClient::createNewPage):
2741         * UIProcess/API/C/WKPage.cpp:
2742         (WebKit::RunBeforeUnloadConfirmPanelResultListener::create):
2743         (WebKit::RunBeforeUnloadConfirmPanelResultListener::RunBeforeUnloadConfirmPanelResultListener):
2744         (WebKit::RunJavaScriptAlertResultListener::create):
2745         (WebKit::RunJavaScriptAlertResultListener::RunJavaScriptAlertResultListener):
2746         (WebKit::RunJavaScriptConfirmResultListener::create):
2747         (WebKit::RunJavaScriptConfirmResultListener::RunJavaScriptConfirmResultListener):
2748         (WebKit::RunJavaScriptPromptResultListener::create):
2749         (WebKit::RunJavaScriptPromptResultListener::RunJavaScriptPromptResultListener):
2750         (WKPageSetPageUIClient):
2751         * UIProcess/API/Cocoa/WKWebView.mm:
2752         (-[WKWebView _takeViewSnapshot]):
2753         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2754         * UIProcess/Cocoa/UIDelegate.h:
2755         * UIProcess/Cocoa/UIDelegate.mm:
2756         (WebKit::UIDelegate::UIClient::createNewPage):
2757         * UIProcess/ios/WKGeolocationProviderIOS.mm:
2758         (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]):
2759         * UIProcess/mac/WKImmediateActionController.mm:
2760         (-[WKImmediateActionController _webHitTestResult]):
2761         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2762         (contextMenuItems):
2763         (WKBundlePageCopyContextMenuItems):
2764         (WKBundlePageCopyContextMenuAtPointInWindow):
2765         * WebProcess/UserContent/WebUserContentController.cpp:
2766         (WebKit::WebUserMessageHandlerDescriptorProxy::create):
2767         * WebProcess/WebPage/WebUndoStep.cpp:
2768         (WebKit::WebUndoStep::create):
2769         * WebProcess/WebPage/WebUndoStep.h:
2770         (WebKit::WebUndoStep::WebUndoStep):
2771
2772 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
2773
2774         Remove PageThrottler & all related code
2775         https://bugs.webkit.org/show_bug.cgi?id=164302
2776
2777         Reviewed by Ryosuke Niwa.
2778
2779         All relevant information now available from the ActivityState.
2780
2781         * PluginProcess/PluginProcess.cpp:
2782         (WebKit::PluginProcess::PluginProcess):
2783         (WebKit::PluginProcess::createWebProcessConnection):
2784         (WebKit::PluginProcess::audioHardwareDidBecomeActive): Deleted.
2785         (WebKit::PluginProcess::audioHardwareDidBecomeInactive): Deleted.
2786         * PluginProcess/PluginProcess.h:
2787         (): Deleted.
2788         * PluginProcess/WebProcessConnection.cpp:
2789         (WebKit::WebProcessConnection::audioHardwareDidBecomeActive): Deleted.
2790         (WebKit::WebProcessConnection::audioHardwareDidBecomeInactive): Deleted.
2791         * PluginProcess/WebProcessConnection.h:
2792         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
2793         (WebKit::NPRuntimeObjectMap::evaluate):
2794         * WebProcess/Plugins/Plugin.h:
2795         (WebKit::Plugin::audioHardwareActivity): Deleted.
2796         * WebProcess/Plugins/PluginProcessConnection.cpp:
2797         (WebKit::PluginProcessConnection::PluginProcessConnection):
2798         (WebKit::PluginProcessConnection::didReceiveMessage):
2799         (WebKit::PluginProcessConnection::audioHardwareDidBecomeActive): Deleted.
2800         (WebKit::PluginProcessConnection::audioHardwareDidBecomeInactive): Deleted.
2801         * WebProcess/Plugins/PluginProcessConnection.h:
2802         (WebKit::PluginProcessConnection::supportsAsynchronousPluginInitialization):
2803         (WebKit::PluginProcessConnection::audioHardwareActivity): Deleted.
2804         * WebProcess/Plugins/PluginProcessConnection.messages.in:
2805         * WebProcess/Plugins/PluginProxy.cpp:
2806         (WebKit::PluginProxy::audioHardwareActivity): Deleted.
2807         * WebProcess/Plugins/PluginProxy.h:
2808         * WebProcess/Plugins/PluginView.cpp:
2809         (WebKit::PluginView::audioHardwareActivity): Deleted.
2810         * WebProcess/Plugins/PluginView.h:
2811         * WebProcess/WebPage/WebPage.cpp:
2812
2813 2016-11-03  Dan Bernstein  <mitz@apple.com>
2814
2815         REGRESSION (r206247): Painting milestones can be delayed until the next layer flush
2816         https://bugs.webkit.org/show_bug.cgi?id=164340
2817         <rdar://problem/29074344>
2818
2819         Reviewed by Tim Horton.
2820
2821         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: Declared new helper function.
2822         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2823         (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones): Helper
2824           function that sends the message to the UI process and resets
2825           m_pendingNewlyReachedLayoutMilestones.
2826         (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Wait until after the commit to get the
2827           pending milestones and send them to the UI process. This way we don’t miss milestones that
2828           fire during the commit.
2829
2830 2016-11-02  David Kilzer  <ddkilzer@apple.com>
2831
2832         Bug 164333: Add logging for "WebKit encountered an internal error" messages due to Network process crashes
2833         <https://webkit.org/b/164333>
2834         <rdar://problem/29072727>
2835
2836         Reviewed by Alex Christensen.
2837
2838         * WebProcess/WebProcess.cpp:
2839         (WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
2840         Add private method to log diagnostic message.
2841         (WebKit::WebProcess::networkProcessConnectionClosed):
2842         Call logDiagnosticMessageForNetworkProcessCrash().
2843         * WebProcess/WebProcess.h:
2844         (WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
2845         Declare new method.
2846
2847 2016-11-02  Alex Christensen  <achristensen@webkit.org>
2848
2849         Remove Battery Status API from the tree
2850         https://bugs.webkit.org/show_bug.cgi?id=164213
2851
2852         Reviewed by Sam Weinig.
2853
2854         * CMakeLists.txt:
2855         * PlatformEfl.cmake:
2856         * Shared/API/APIObject.h:
2857         * Shared/API/c/WKBase.h:
2858         * Shared/WebBatteryStatus.cpp: Removed.
2859         * Shared/WebBatteryStatus.h: Removed.
2860         * UIProcess/API/C/WKAPICast.h:
2861         * UIProcess/API/C/WKBatteryManager.cpp: Removed.
2862         * UIProcess/API/C/WKBatteryManager.h: Removed.
2863         * UIProcess/API/C/WKBatteryStatus.cpp: Removed.
2864         * UIProcess/API/C/WKBatteryStatus.h: Removed.
2865         * UIProcess/API/C/WKContext.cpp:
2866         (WKContextGetBatteryManager): Deleted.
2867         * UIProcess/API/C/WKContext.h:
2868         * UIProcess/API/efl/ewk_context.cpp:
2869         (EwkContext::EwkContext):
2870         * UIProcess/API/efl/ewk_context_private.h:
2871         * UIProcess/API/efl/ewk_main.cpp:
2872         (WebKit::EwkMain::initialize):
2873         (WebKit::EwkMain::finalize):
2874         (WebKit::EwkMain::shutdownInitializedEFLModules):
2875         * UIProcess/API/gtk/WebKitBatteryProvider.cpp: Removed.
2876         * UIProcess/API/gtk/WebKitBatteryProvider.h: Removed.
2877         * UIProcess/API/gtk/WebKitWebContext.cpp:
2878         (webkitWebContextConstructed):
2879         * UIProcess/WebBatteryManagerProxy.cpp: Removed.
2880         * UIProcess/WebBatteryManagerProxy.h: Removed.
2881         * UIProcess/WebBatteryManagerProxy.messages.in: Removed.
2882         * UIProcess/WebBatteryProvider.cpp: Removed.
2883         * UIProcess/WebBatteryProvider.h: Removed.
2884         * UIProcess/WebProcessPool.cpp:
2885         (WebKit::m_hiddenPageThrottlingTimer):
2886         * UIProcess/efl/BatteryProvider.cpp: Removed.
2887         * UIProcess/efl/BatteryProvider.h: Removed.
2888         * WebProcess/Battery: Removed.
2889         * WebProcess/Battery/WebBatteryManager.cpp: Removed.
2890         * WebProcess/Battery/WebBatteryManager.h: Removed.
2891         * WebProcess/Battery/WebBatteryManager.messages.in: Removed.
2892         * WebProcess/WebCoreSupport/WebBatteryClient.cpp: Removed.
2893         * WebProcess/WebCoreSupport/WebBatteryClient.h: Removed.
2894         * WebProcess/WebPage/WebPage.cpp:
2895         (WebKit::m_userInterfaceLayoutDirection):
2896         * WebProcess/WebProcess.cpp:
2897         (WebKit::m_resourceLoadStatisticsStorage):
2898
2899 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2900
2901         NetworkSession: Add NetworkDataTask implementation for blobs
2902         https://bugs.webkit.org/show_bug.cgi?id=163939
2903
2904         Reviewed by Alex Christensen.
2905
2906         Add NetworkDataTaskBlob to handle blobs when using NetworkSession instead of using ResourceHandle. This patch
2907         adds more USE(NETWORK_SESSION) ifdefs to not use ResourceHandle in Downloads and NetworkLoad when NetworkSession
2908         is enabled.
2909
2910         * CMakeLists.txt: Add new files to compilation.
2911         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
2912         * NetworkProcess/Downloads/BlobDownloadClient.h:
2913         * NetworkProcess/Downloads/Download.cpp:
2914         (WebKit::Download::Download): Split the constructor again and remove the PlatformDownloadTaskRef
2915         definitions. Now Cocoa specific constructor receives a NSURLSessionDownloadTask and the general constructor
2916         reveices a NetworkDataTask and is used by Soup backend and blobs.
2917         (WebKit::Download::~Download):
2918         (WebKit::Download::start):
2919         (WebKit::Download::startWithHandle):
2920         (WebKit::Download::cancel):
2921         (WebKit::Download::didReceiveAuthenticationChallenge):
2922         (WebKit::Download::didReceiveData):
2923         (WebKit::Download::didFinish):
2924         (WebKit::Download::platformCancelNetworkLoad): Rename cancelNetworkLoad() as platformCancelNetworkLoad() since
2925         this is now used only by Cocoa platform to cancel the NSURLSessionDownloadTask.
2926         * NetworkProcess/Downloads/Download.h:
2927         (WebKit::Download::Download):
2928         (WebKit::Download::suggestedName):
2929         (WebKit::Download::request):
2930         * NetworkProcess/Downloads/DownloadManager.cpp:
2931         (WebKit::DownloadManager::startDownload): Remove blobs specific code when using NetworkSession.
2932         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
2933         * NetworkProcess/Downloads/DownloadManager.h:
2934         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
2935         (WebKit::Download::platformCancelNetworkLoad):
2936         * NetworkProcess/Downloads/soup/DownloadSoup.cpp: Removed.
2937         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2938         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Remove blobs specific code when
2939         using NetworkSession.
2940         * NetworkProcess/NetworkDataTask.cpp:
2941         (WebKit::NetworkDataTask::create): If request is a blob, create a NetworkDataTaskBlob.
2942         * NetworkProcess/NetworkDataTask.h: Add invalidateAndCancel pure virtual method.
2943         * NetworkProcess/NetworkDataTaskBlob.cpp: Added.
2944         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
2945         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
2946         (WebKit::NetworkDataTaskBlob::clearStream):
2947         (WebKit::NetworkDataTaskBlob::resume):
2948         (WebKit::NetworkDataTaskBlob::suspend):
2949         (WebKit::NetworkDataTaskBlob::cancel):
2950         (WebKit::NetworkDataTaskBlob::invalidateAndCancel):
2951         (WebKit::NetworkDataTaskBlob::getSizeForNext):
2952         (WebKit::NetworkDataTaskBlob::didGetSize):
2953         (WebKit::NetworkDataTaskBlob::seek):
2954         (WebKit::NetworkDataTaskBlob::didReceiveResponse):
2955         (WebKit::NetworkDataTaskBlob::read):
2956         (WebKit::NetworkDataTaskBlob::readData):
2957         (WebKit::NetworkDataTaskBlob::readFile):
2958         (WebKit::NetworkDataTaskBlob::didOpen):
2959         (WebKit::NetworkDataTaskBlob::didRead):
2960         (WebKit::NetworkDataTaskBlob::consumeData):
2961         (WebKit::NetworkDataTaskBlob::setPendingDownloadLocation):
2962         (WebKit::NetworkDataTaskBlob::suggestedFilename):
2963         (WebKit::NetworkDataTaskBlob::download):
2964         (WebKit::NetworkDataTaskBlob::writeDownload):
2965         (WebKit::NetworkDataTaskBlob::cleanDownloadFiles):
2966         (WebKit::NetworkDataTaskBlob::didFailDownload):
2967         (WebKit::NetworkDataTaskBlob::didFinishDownload):
2968         (WebKit::NetworkDataTaskBlob::didFail):
2969         (WebKit::NetworkDataTaskBlob::didFinish):
2970         * NetworkProcess/NetworkDataTaskBlob.h: Added.
2971         * NetworkProcess/NetworkLoad.cpp:
2972         (WebKit::NetworkLoad::NetworkLoad): Remove blobs specific code when using NetworkSession.
2973         (WebKit::NetworkLoad::~NetworkLoad):
2974         (WebKit::NetworkLoad::setDefersLoading):
2975         (WebKit::NetworkLoad::cancel):
2976         (WebKit::NetworkLoad::continueWillSendRequest):
2977         (WebKit::NetworkLoad::continueDidReceiveResponse):
2978         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
2979         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
2980         * NetworkProcess/NetworkLoad.h:
2981         * NetworkProcess/NetworkSession.cpp:
2982         (WebKit::NetworkSession::invalidateAndCancel): Moved from NetworkSessionSoup, since this is now used also by blobs.
2983         * NetworkProcess/NetworkSession.h:
2984         (WebKit::NetworkSession::registerNetworkDataTask): Ditto.
2985         (WebKit::NetworkSession::unregisterNetworkDataTask): Ditto.
2986         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Add invalidateAndCancel() implementation that does nothing
2987         because in Cocoa all tasks are invalidated and canceled by the network session.
2988         * NetworkProcess/mac/NetworkLoadMac.mm:
2989         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2990         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
2991         (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
2992         (WebKit::NetworkDataTaskSoup::download):
2993         * NetworkProcess/soup/NetworkDataTaskSoup.h:
2994         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2995         * NetworkProcess/soup/NetworkSessionSoup.h:
2996         * PlatformEfl.cmake: Remove DownloadSoup.cpp from compilation.
2997         * PlatformGTK.cmake: Ditto.
2998         * WebKit2.xcodeproj/project.pbxproj: Add new files to compilation.
2999
3000 2016-11-02  Andy Estes  <aestes@apple.com>
3001
3002         REGRESSION (r199558): File paths selected for upload are stored using the wrong string encoding
3003         https://bugs.webkit.org/show_bug.cgi?id=164311
3004         <rdar://problem/26995374>
3005
3006         Reviewed by Tim Horton.
3007
3008         -[NSURL fileSystemRepresentation] returns a char* in file system representation, which on
3009         iOS is UTF-8, but we were implicitly converting it to a String, which assumes a char* is
3010         Latin-1 encoded.
3011
3012         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3013         (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]): Changed to use fromUTF8() to
3014         convert fileURL.fileSystemRepresentation to a String.
3015
3016 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3017
3018         NetworkSession: Network process crash when converting main resource to download
3019         https://bugs.webkit.org/show_bug.cgi?id=164220
3020
3021         Reviewed by Alex Christensen.
3022
3023         Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
3024         sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
3025         NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
3026         download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
3027         NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
3028         having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
3029         load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
3030         NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
3031         client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
3032         created yet. That's not expected to happen and when the response completion handler is called in the
3033         NetworkDataTask it tries to use either the client or the download and it crashes.
3034
3035         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3036         (WebKit::NetworkConnectionToWebProcess::removeLoadIdentifier): Update ASSERT, because abort doesn't cleanup the
3037         resource loader in case it's becoming a download.
3038         * NetworkProcess/NetworkResourceLoader.cpp:
3039         (WebKit::NetworkResourceLoader::didBecomeDownload): Call cleanup() instead of just deleting the network load.
3040         (WebKit::NetworkResourceLoader::isBecomingDownload): Helper method to check if the resource load was converted to a
3041         download, but didBecomeDownload() hasn't been called yet.
3042         (WebKit::NetworkResourceLoader::abort): If the resource load is becoming a download do not call cleanup()
3043         because it will be called by didBecomeDownload() later.
3044         * NetworkProcess/NetworkResourceLoader.h:
3045
3046 2016-11-02  David Kilzer  <ddkilzer@apple.com>
3047
3048         Add logging for "WebKit encountered an internal error" messages
3049         <https://webkit.org/b/164272>
3050         <rdar://problem/28546064>
3051
3052         Reviewed by Alex Christensen.
3053
3054         * NetworkProcess/NetworkResourceLoader.cpp:
3055         (WebKit::NetworkResourceLoader::startNetworkLoad):
3056         * WebProcess/Network/WebLoaderStrategy.cpp:
3057         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
3058         * WebProcess/Network/WebResourceLoader.cpp:
3059         (WebKit::WebResourceLoader::didReceiveResource):
3060         - Add logging for various internalError() events.
3061
3062 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3063
3064         [GTK] BadDamage X Window System error in WebKit::AcceleratedBackingStoreX11::update when called from WebPageProxy::exitAcceleratedCompositingMode
3065         https://bugs.webkit.org/show_bug.cgi?id=164303
3066
3067         Reviewed by Michael Catanzaro.
3068
3069         This can happen if the web process exits before the UI process has cleaned up the accelerated surface. Trap
3070         BadDrawable and BadDamage X errors and ignore them, while still crashing for any other X error.
3071
3072         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
3073         (WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11):
3074         (WebKit::AcceleratedBackingStoreX11::update):
3075
3076 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3077
3078         [GTK] Remove FileSystem::filenameToString() and use FileSystem::stringFromFileSystemRepresentation() everywhere instead
3079         https://bugs.webkit.org/show_bug.cgi?id=164315
3080
3081         Reviewed by Michael Catanzaro.
3082
3083         * Shared/gtk/ProcessExecutablePathGtk.cpp:
3084         (WebKit::getExecutablePath):
3085         (WebKit::findWebKitProcess):
3086         * UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp:
3087         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
3088         (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
3089         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
3090         * UIProcess/API/gtk/WebKitWebContext.cpp:
3091         (webkitWebContextConstructed):
3092         (webkit_web_context_set_favicon_database_directory):
3093         (webkit_web_context_set_additional_plugins_directory):
3094         (webkit_web_context_set_disk_cache_directory):
3095         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
3096         (webkitWebsiteDataManagerGetDataStore):
3097         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
3098         (WebKit::PluginInfoCache::PluginInfoCache):
3099         * UIProcess/gtk/WebProcessPoolGtk.cpp:
3100         (WebKit::WebProcessPool::platformDefaultIconDatabasePath):
3101         * WebProcess/gtk/WebGtkExtensionManager.cpp:
3102         (WebKit::parseUserData):
3103
3104 2016-11-02  Romain Bellessort  <romain.bellessort@crf.canon.fr>
3105
3106         [Readable Streams API] Enable creation of ReadableByteStreamController
3107         https://bugs.webkit.org/show_bug.cgi?id=164014
3108
3109         Reviewed by Youenn Fablet.
3110
3111         Added flag for the byte stream part of Readable Streams API.
3112
3113         * Configurations/FeatureDefines.xcconfig:
3114
3115 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3116
3117         PluginInfoStore::loadPluginsIfNecessary can still load plugins multiple times
3118         https://bugs.webkit.org/show_bug.cgi?id=164103
3119
3120         Reviewed by Michael Catanzaro.
3121
3122         Follow symlinks when scanning plugins to avoid duplicates.
3123
3124         * UIProcess/Plugins/gtk/PluginInfoCache.cpp: Bump the cache version to ensure duplicated plugins are removed
3125         from the cache.
3126         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
3127         (WebKit::PluginInfoStore::pluginPathsInDirectory): Use realpath() to always return the actual file path.
3128
3129 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3130
3131         [GTK] Plugin process crash in WebKit::NetscapePluginX11::visibilityDidChange with evince browser plugin
3132         https://bugs.webkit.org/show_bug.cgi?id=164204
3133
3134         Reviewed by Michael Catanzaro.
3135
3136         Check the platform plugin widget is embedded before trying to get its socket window.
3137
3138         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
3139         (WebKit::NetscapePluginX11::geometryDidChange):
3140         (WebKit::NetscapePluginX11::visibilityDidChange):
3141
3142 2016-11-01  Wenson Hsieh  <wenson_hsieh@apple.com>
3143
3144         Turn the Input Events runtime flag on by default
3145         https://bugs.webkit.org/show_bug.cgi?id=164297
3146
3147         Reviewed by Ryosuke Niwa.
3148
3149         * Shared/WebPreferencesDefinitions.h:
3150
3151 2016-11-01  Jaehun Lim  <ljaehun.lim@samsung.com>
3152
3153         Unreviewed, EFL build fix after r208225
3154
3155         Rename ViewState to ActivityState
3156
3157         * UIProcess/efl/WebView.cpp:
3158         (WebKit::WebView::setActive):
3159         (WebKit::WebView::setFocused):
3160         (WebKit::WebView::setVisible):
3161
3162 2016-11-01  Alex Christensen  <achristensen@webkit.org>
3163
3164         Fix CMake build.
3165
3166         * PlatformMac.cmake:
3167
3168 2016-11-01  Ryosuke Niwa  <rniwa@webkit.org>
3169
3170         Remove CUSTOM_ELEMENTS build flag
3171         https://bugs.webkit.org/show_bug.cgi?id=164267
3172
3173         Reviewed by Antti Koivisto.
3174
3175         Removed the build flag.
3176
3177         * Configurations/FeatureDefines.xcconfig:
3178         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3179         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3180         * WebProcess/WebPage/WebPage.cpp:
3181         (WebKit::WebPage::updatePreferences):
3182
3183 2016-11-01  Eric Carlson  <eric.carlson@apple.com>
3184
3185         [MediaStream] restrict media capture secure connections
3186         https://bugs.webkit.org/show_bug.cgi?id=164234
3187         <rdar://problem/28944906>
3188
3189         Reviewed by Alex Christensen.
3190
3191         * Shared/WebPreferencesDefinitions.h:
3192    
3193         * UIProcess/API/C/WKPreferences.cpp:
3194         (WKPreferencesSetMediaCaptureRequiresSecureConnection):
3195         (WKPreferencesGetMediaCaptureRequiresSecureConnection):
3196         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3197    
3198         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3199         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Drive by
3200          fix: remove some unused parameters in a lambda call.
3201
3202         * WebProcess/WebPage/WebPage.cpp:
3203         (WebKit::WebPage::updatePreferences):
3204
3205 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
3206
3207         Add IsAudible, IsLoading to ActivityState
3208         https://bugs.webkit.org/show_bug.cgi?id=164286
3209
3210         Reviewed by Geoff Garen.
3211
3212         By computing these values in the UIProcess and passing them to WebContent we can
3213         more closely unify iOS & macOS throttling, and remove the PageThrottler class.
3214
3215         * UIProcess/WebPageProxy.cpp:
3216         (WebKit::WebPageProxy::updateActivityState):
3217             - Added update for IsAudible, IsLoading flags.
3218         (WebKit::WebPageProxy::updateThrottleState):
3219             - Read IsAudible, IsLoading flags from ActivityState.
3220         (WebKit::WebPageProxy::setMuted):
3221             - call activityStateDidChange to trigger update.
3222         (WebKit::WebPageProxy::isPlayingMediaDidChange):
3223             - call activityStateDidChange to trigger update.
3224         * UIProcess/WebPageProxy.h:
3225         (WebKit::WebPageProxy::isLoadingChanged):
3226             - call activityStateDidChange to trigger update.
3227
3228 2016-10-31  Gavin Barraclough  <barraclough@apple.com>
3229
3230         Rename ViewState to ActivityState
3231         https://bugs.webkit.org/show_bug.cgi?id=164254
3232
3233         Reviewed by Andreas Kling.
3234
3235         We plan to add a couple more flags to ViewState that aren't directly related to the view
3236         itself - whether there is an ongoing page load, and whether whether there is audio playback.
3237         This will allow viewState (now activityState) to fully drive throttling decisions.
3238
3239         Renaming this bitfield accordingly.
3240
3241         * Shared/WebPageCreationParameters.cpp:
3242         (WebKit::WebPageCreationParameters::encode):
3243         (WebKit::WebPageCreationParameters::decode):
3244         * Shared/WebPageCreationParameters.h:
3245         * UIProcess/API/Cocoa/WKWebView.mm:
3246         (-[WKWebView didMoveToWindow]):
3247         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3248         (_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate):
3249         (_WebKitWebViewBasePrivate::updateActivityStateTimerFired):
3250         (webkitWebViewBaseScheduleUpdateActivityState):
3251         (toplevelWindowFocusInEvent):
3252         (toplevelWindowFocusOutEvent):
3253         (toplevelWindowStateEvent):
3254         (webkitWebViewBaseSetToplevelOnScreenWindow):
3255         (webkitWebViewBaseMap):
3256         (webkitWebViewBaseUnmap):
3257         (webkitWebViewBaseSetFocus):
3258         (webkitWebViewBaseIsInWindowActive):
3259         (webkitWebViewBaseIsFocused):
3260         (webkitWebViewBaseIsVisible):
3261         (webkitWebViewBaseIsInWindow):
3262         (_WebKitWebViewBasePrivate::updateViewStateTimerFired): Deleted.
3263         (webkitWebViewBaseScheduleUpdateViewState): Deleted.
3264         * UIProcess/Cocoa/WebViewImpl.mm:
3265         (WebKit::WebViewImpl::becomeFirstResponder):
3266         (WebKit::WebViewImpl::resignFirstResponder):
3267         (WebKit::WebViewImpl::windowDidOrderOffScreen):
3268         (WebKit::WebViewImpl::windowDidOrderOnScreen):
3269         (WebKit::WebViewImpl::windowDidBecomeKey):
3270         (WebKit::WebViewImpl::windowDidResignKey):
3271         (WebKit::WebViewImpl::windowDidMiniaturize):
3272         (WebKit::WebViewImpl::windowDidDeminiaturize):
3273         (WebKit::WebViewImpl::windowDidChangeOcclusionState):
3274         (WebKit::WebViewImpl::viewDidMoveToWindow):
3275         (WebKit::WebViewImpl::viewDidHide):
3276         (WebKit::WebViewImpl::viewDidUnhide):
3277         (WebKit::WebViewImpl::activeSpaceDidChange):
3278         (WebKit::WebViewImpl::endDeferringViewInWindowChanges):
3279         (WebKit::WebViewImpl::endDeferringViewInWindowChangesSync):
3280         (WebKit::WebViewImpl::prepareForMoveToWindow):
3281         * UIProcess/DrawingAreaProxy.h:
3282         (WebKit::DrawingAreaProxy::waitForDidUpdateActivityState):
3283         (WebKit::DrawingAreaProxy::waitForDidUpdateViewState): Deleted.
3284         * UIProcess/WebPageProxy.cpp:
3285         (WebKit::WebPageProxy::WebPageProxy):
3286         (WebKit::WebPageProxy::reattachToWebProcess):
3287         (WebKit::WebPageProxy::setSuppressVisibilityUpdates):
3288         (WebKit::WebPageProxy::updateActivityState):
3289         (WebKit::WebPageProxy::activityStateDidChange):
3290         (WebKit::WebPageProxy::dispatchActivityStateChange):
3291         (WebKit::WebPageProxy::updateThrottleState):
3292         (WebKit::WebPageProxy::waitForDidUpdateActivityState):
3293         (WebKit::WebPageProxy::creationParameters):
3294         (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
3295         (WebKit::WebPageProxy::updateViewState): Deleted.
3296         (WebKit::WebPageProxy::viewStateDidChange): Deleted.
3297         (WebKit::WebPageProxy::dispatchViewStateChange): Deleted.
3298         (WebKit::WebPageProxy::waitForDidUpdateViewState): Deleted.
3299         (WebKit::WebPageProxy::installViewStateChangeCompletionHandler): Deleted.
3300         * UIProcess/WebPageProxy.h:
3301         (WebKit::WebPageProxy::isInWindow):
3302         (WebKit::WebPageProxy::didUpdateActivityState):
3303         (WebKit::WebPageProxy::isViewVisible):
3304         (WebKit::WebPageProxy::didUpdateViewState): Deleted.
3305         * UIProcess/WebPageProxy.messages.in:
3306         * UIProcess/WebProcessProxy.cpp:
3307         (WebKit::WebProcessProxy::windowServerConnectionStateChanged):
3308         * UIProcess/efl/WebView.cpp:
3309         * UIProcess/ios/WKContentView.mm:
3310         (-[WKContentView _applicationDidEnterBackground]):
3311         (-[WKContentView _applicationWillEnterForeground]):
3312         * UIProcess/ios/WKPDFView.mm:
3313         (-[WKPDFView _applicationDidEnterBackground]):
3314         (-[WKPDFView _applicationWillEnterForeground]):
3315         * UIProcess/ios/WebPageProxyIOS.mm:
3316         (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
3317         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
3318         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3319         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
3320         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
3321         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState): Deleted.
3322         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
3323         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
3324         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
3325         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateViewState): Deleted.
3326         * WebProcess/Plugins/PluginView.cpp:
3327         (WebKit::PluginView::activityStateDidChange):
3328         (WebKit::PluginView::viewStateDidChange): Deleted.
3329         * WebProcess/Plugins/PluginView.h:
3330         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
3331         (WebKit::AcceleratedDrawingArea::activityStateDidChange):
3332         (WebKit::AcceleratedDrawingArea::viewStateDidChange): Deleted.
3333         * WebProcess/WebPage/AcceleratedDrawingArea.h:
3334         * WebProcess/WebPage/DrawingArea.h:
3335         (WebKit::DrawingArea::activityStateDidChange):
3336         (WebKit::DrawingArea::viewStateDidChange): Deleted.
3337         * WebProcess/WebPage/WebPage.cpp:
3338         (WebKit::m_userInterfaceLayoutDirection):
3339         (WebKit::WebPage::reinitializeWebPage):
3340         (WebKit::WebPage::updateIsInWindow):
3341         (WebKit::WebPage::setActivityState):
3342         (WebKit::WebPage::setViewState): Deleted.
3343         * WebProcess/WebPage/WebPage.h:
3344         (WebKit::WebPage::isVisible):
3345         (WebKit::WebPage::isVisibleOrOccluded):
3346         * WebProcess/WebPage/WebPage.messages.in:
3347         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
3348         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3349         (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
3350         (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange): Deleted.
3351         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3352         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3353         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
3354         (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
3355         (WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired):
3356         (WebKit::TiledCoreAnimationDrawingArea::viewStateDidChange): Deleted.
3357         (WebKit::TiledCoreAnimationDrawingArea::didUpdateViewStateTimerFired): Deleted.
3358
3359 2016-10-31  Jaehun Lim  <ljaehun.lim@samsung.com>
3360
3361         Unreviewed, CMake build fix
3362
3363         Adds #include <WebCore/IDBGetAllRecordsData.h>
3364
3365         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
3366
3367 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
3368
3369         Add basic visual/layout viewport support for fixed position layout
3370         https://bugs.webkit.org/show_bug.cgi?id=164261
3371
3372         Reviewed by Dean Jackson.
3373
3374         Don't make visualViewportEnabled an experimental feature, because I don't want it enabled
3375         by default in WebKitTestRunner (and therefore mismatching DumpRenderTree).
3376
3377         * Shared/WebPreferencesDefinitions.h:
3378
3379 2016-10-29  Filip Pizlo  <fpizlo@apple.com>
3380
3381         JSC should support SharedArrayBuffer
3382         https://bugs.webkit.org/show_bug.cgi?id=163986
3383
3384         Reviewed by Keith Miller.
3385         
3386         Adds some small things we need for SharedArrayBuffer.
3387
3388         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3389         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3390         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3391         (WebKit::InjectedBundle::createWebDataFromUint8Array):
3392
3393 2016-10-31  Brady Eidson  <beidson@apple.com>
3394
3395         IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
3396         <rdar://problem/28806934> and https://bugs.webkit.org/show_bug.cgi?id=164097
3397
3398         Reviewed by Darin Adler.
3399
3400         - Handle moving "Get All" requests to and from the DatabaseProcess.
3401         - Handle the additional task of creating/passing Sandbox Extensions for
3402           referenced files when necessary. 
3403           
3404         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
3405         (WebKit::WebIDBConnectionToClient::handleGetResult):
3406         (WebKit::WebIDBConnectionToClient::didGetAllRecords):
3407         (WebKit::WebIDBConnectionToClient::getAllRecords):
3408         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
3409         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
3410         
3411         * Shared/WebCoreArgumentCoders.h:
3412         
3413         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3414         (WebKit::WebIDBConnectionToServer::getAllRecords):
3415         (WebKit::preregisterSandboxExtensionsIfNecessary):
3416         (WebKit::WebIDBConnectionToServer::didGetAllRecords):
3417         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
3418         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
3419
3420 2016-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
3421
3422         [WK1] Candidate visibility should not update as a result of selection during a dictionary lookup
3423         https://bugs.webkit.org/show_bug.cgi?id=164236
3424         <rdar://problem/28747712>
3425
3426         Reviewed by Beth Dakin.
3427
3428         See WebCore ChangeLog for more detail. Removes m_isGettingDictionaryPopupInfo from the WebPage in favor of
3429         keeping track of the same state in Editor, so that both the WK1 and WK2 cases can share the same codepath.
3430
3431         * WebProcess/WebPage/WebPage.cpp:
3432         (WebKit::WebPage::didChangeSelection):
3433         * WebProcess/WebPage/WebPage.h:
3434         * WebProcess/WebPage/mac/WebPageMac.mm:
3435         (WebKit::WebPage::dictionaryPopupInfoForRange):
3436
3437 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
3438
3439         Implement IntersectionObserver
3440         https://bugs.webkit.org/show_bug.cgi?id=159475
3441
3442         Reviewed by Ryosuke Niwa.
3443
3444         Add ENABLE_INTERSECTION_OBSERVER, enabled by default.
3445
3446         * Configurations/FeatureDefines.xcconfig:
3447
3448 2016-10-31  Ryan Haddad  <ryanhaddad@apple.com>
3449
3450         Unreviewed, rolling out r208154.
3451
3452         This change caused an assertion failure during API tests on
3453         macOS.
3454
3455         Reverted changeset:
3456
3457         "NetworkSession: Network process crash when converting main
3458         resource to download"
3459         https://bugs.webkit.org/show_bug.cgi?id=164220
3460         http://trac.webkit.org/changeset/208154
3461
3462 2016-10-28  Brent Fulgham  <bfulgham@apple.com>
3463
3464         Do a better job of protecting Frame objects in the context of JavaScript calls
3465         https://bugs.webkit.org/show_bug.cgi?id=164163
3466         <rdar://problem/28955249>
3467
3468         Reviewed by Darin Adler.
3469
3470         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
3471         (WebKit::InjectedBundleRangeHandle::renderedImage): Protected the Frame.
3472         * WebProcess/WebPage/WebPage.cpp:
3473         (WebKit::WebPage::insertTextAsync): Ditto.
3474         (WebKit::WebPage::setComposition): Ditto.
3475         * WebProcess/WebPage/mac/WebPageMac.mm:
3476         (WebKit::WebPage::insertDictatedTextAsync): Ditto.
3477
3478 2016-10-31  Carlos Garcia Campos  <cgarcia@igalia.com>
3479
3480         NetworkSession: Network process crash when converting main resource to download
3481         https://bugs.webkit.org/show_bug.cgi?id=164220
3482
3483         Reviewed by Alex Christensen.
3484
3485         Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
3486         sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
3487         NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
3488         download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
3489         NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
3490         having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
3491         load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
3492         NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
3493         client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
3494         created yet. That's not expected to happen and when the response completion handler is called in the
3495         NetworkDataTask it tries to use either the client or the download and it crashes.
3496
3497         * NetworkProcess/NetworkResourceLoader.cpp:
3498         (WebKit::NetworkResourceLoader::didBecomeDownload): Call cleanup() instead of just deleting the network load.
3499         (WebKit::NetworkResourceLoader::abort): If we still have a network load that was converted to a download, do not
3500         call cleanup() because it will be called by didBecomeDownload() later.
3501
3502 2016-10-31  Darin Adler  <darin@apple.com>
3503
3504         Move ChildNode and ParentNode from ExceptionCode to Exception, add support for ExceptionOr<T&>
3505         https://bugs.webkit.org/show_bug.cgi?id=164214
3506
3507         Reviewed by Alex Christensen.
3508
3509         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
3510         (webkit_dom_document_query_selector): Updated exception handling.
3511         (webkit_dom_document_query_selector_all): Ditto.
3512         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
3513         (webkit_dom_document_fragment_query_selector): Ditto.
3514         (webkit_dom_document_fragment_query_selector_all): Ditto.
3515         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
3516         (webkit_dom_element_query_selector): Ditto.
3517         (webkit_dom_element_query_selector_all): Ditto.
3518
3519 2016-10-31  Darin Adler  <darin@apple.com>
3520
3521         Convert Document from ExceptionCode to Exception
3522         https://bugs.webkit.org/show_bug.cgi?id=164212
3523
3524         Reviewed by Alex Christensen.
3525
3526         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
3527         (webkit_dom_document_create_element): Updated exception handling.
3528         (webkit_dom_document_create_cdata_section): Ditto.
3529         (webkit_dom_document_create_processing_instruction): Ditto.
3530         (webkit_dom_document_create_attribute): Ditto.
3531         (webkit_dom_document_import_node): Ditto.
3532         (webkit_dom_document_create_element_ns): Ditto.
3533         (webkit_dom_document_create_attribute_ns): Ditto.
3534         (webkit_dom_document_adopt_node): Ditto.
3535         (webkit_dom_document_create_event): Ditto.
3536         (webkit_dom_document_set_xml_version): Ditto.
3537         (webkit_dom_document_get_cookie): Ditto.
3538         (webkit_dom_document_set_cookie): Ditto.
3539         (webkit_dom_document_set_body): Ditto.
3540         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
3541         (-[WKDOMDocument createElement:]): Ditto.
3542
3543 2016-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
3544
3545         Holding down a key to choose an accented character should fire "insertReplacementText" input events
3546         https://bugs.webkit.org/show_bug.cgi?id=164209
3547         <rdar://problem/29019305>
3548
3549         Reviewed by Darin Adler.
3550
3551         When replacing text, call Editor::insertText with the correct TextEventInputType so that WebCore will know to
3552         use EditActionInsertReplacement when creating and applying the corresponding TypingCommand. Additional minor
3553         changes in order to support testing replacement text insertion.
3554
3555         * UIProcess/API/Cocoa/WKWebView.mm:
3556         (-[WKWebView _insertText:replacementRange:]):
3557         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3558         * WebProcess/WebPage/WebPage.cpp:
3559         (WebKit::WebPage::insertTextAsync):
3560
3561 2016-10-30  Darin Adler  <darin@apple.com>
3562
3563         Move Element, NamedNodeMap, and DOMStringMap from ExceptionCode to Exception
3564         https://bugs.webkit.org/show_bug.cgi?id=164206
3565
3566         Reviewed by Chris Dumez.
3567
3568         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
3569         (webkit_dom_named_node_map_set_named_item): Updated exception handling.
3570         (webkit_dom_named_node_map_remove_named_item): Ditto.
3571         (webkit_dom_named_node_map_set_named_item_ns): Ditto.
3572         (webkit_dom_named_node_map_remove_named_item_ns): Ditto.
3573         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
3574         (webkit_dom_element_set_attribute): Ditto.
3575         (webkit_dom_element_set_attribute_node): Ditto.
3576         (webkit_dom_element_remove_attribute_node): Ditto.
3577         (webkit_dom_element_set_attribute_ns): Ditto.
3578         (webkit_dom_element_set_attribute_node_ns): Ditto.
3579         (webkit_dom_element_matches): Ditto.
3580         (webkit_dom_element_closest): Ditto.
3581         (webkit_dom_element_webkit_matches_selector): Ditto.
3582         (webkit_dom_element_insert_adjacent_element): Ditto.
3583         (webkit_dom_element_insert_adjacent_html): Ditto.
3584         (webkit_dom_element_insert_adjacent_text): Ditto.
3585         (webkit_dom_element_set_inner_html): Ditto.
3586         (webkit_dom_element_set_outer_html): Ditto.
3587         * WebProcess/InjectedBundle/API/mac/WKDOMElement.mm:
3588         (-[WKDOMElement setAttribute:value:]): Ditto.
3589
3590 2016-10-30  Yusuke Suzuki  <utatane.tea@gmail.com>
3591
3592         [DOM] Introduce WebCore::jsDynamicDowncast
3593         https://bugs.webkit.org/show_bug.cgi?id=164137
3594
3595         Reviewed by Darin Adler.
3596
3597         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
3598         (WebKit::WebAutomationSessionProxy::elementForNodeHandle):
3599
3600 2016-10-29  Darin Adler  <darin@apple.com>
3601
3602         Convert more of DOM from ExceptionCode to Exception
3603         https://bugs.webkit.org/show_bug.cgi?id=164173
3604
3605         Reviewed by Ryosuke Niwa.
3606
3607         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
3608         (webkit_dom_character_data_substring_data): Updated since this
3609         now uses ExceptionOr.
3610         (webkit_dom_character_data_insert_data): Ditto.
3611         (webkit_dom_character_data_delete_data): Ditto.
3612         (webkit_dom_character_data_replace_data): Ditto.
3613         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
3614         (webkit_dom_text_replace_whole_text): Ditto.
3615         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
3616         (webkit_dom_text_split_text): Ditto.
3617
3618 2016-10-28  Darin Adler  <darin@apple.com>
3619
3620         Move all classes in the HTML directory from ExceptionCode to Exception
3621         https://bugs.webkit.org/show_bug.cgi?id=163876
3622
3623         Reviewed by Sam Weinig.
3624
3625         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
3626         (webkit_dom_dom_token_list_add): Updated exception handling.
3627         (webkit_dom_dom_token_list_remove): Ditto.
3628         (webkit_dom_dom_token_list_toggle): Ditto.
3629         (webkit_dom_dom_token_list_replace): Ditto.
3630         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
3631         (webkit_dom_element_remove): Ditto.
3632         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
3633         (webkit_dom_html_element_set_inner_text): Ditto.
3634         (webkit_dom_html_element_set_outer_text): Ditto.
3635         (webkit_dom_html_element_set_content_editable): Ditto.
3636         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
3637         (webkit_dom_html_input_element_set_max_length): Ditto.
3638         (webkit_dom_html_input_element_set_size): Ditto.
3639         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
3640         (webkit_dom_html_select_element_set_length): Ditto.
3641         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
3642         (webkit_dom_html_table_element_insert_row): Ditto.
3643         (webkit_dom_html_table_element_delete_row): Ditto.
3644         (webkit_dom_html_table_element_set_caption): Ditto.
3645         (webkit_dom_html_table_element_set_t_head): Ditto.
3646         (webkit_dom_html_table_element_set_t_foot): Ditto.
3647         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
3648         (webkit_dom_html_table_row_element_insert_cell): Ditto.
3649         (webkit_dom_html_table_row_element_delete_cell): Ditto.
3650         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
3651         (webkit_dom_html_table_section_element_insert_row): Ditto.
3652         (webkit_dom_html_table_section_element_delete_row): Ditto.
3653
3654         * WebProcess/WebPage/WebPage.cpp:
3655         (WebKit::WebPage::editorState): Removed ASSERT_NO_EXCEPTION.
3656
3657         * WebProcess/WebPage/ios/WebPageIOS.mm:
3658         (WebKit::WebPage::setAssistedNodeValueAsNumber): Removed ASSERT_NO_EXCEPTION.
3659
3660         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
3661         (WebKit::WebPlaybackSessionManager::seekableRangesChanged):
3662         Changed the code to use a different interface to TimeRange that does
3663         not involve exceptions.
3664
3665 2016-10-28  Wenson Hsieh  <wenson_hsieh@apple.com>
3666
3667         iOS autocorrection does not trigger an input event of inputType "insertReplacementText"
3668         https://bugs.webkit.org/show_bug.cgi?id=164077
3669         <rdar://problem/28987810>
3670
3671         Reviewed by Simon Fraser.
3672
3673         Small tweak to mark text insertion when autocorrecting as such, as opposed to regular keyboard input.
3674
3675         * WebProcess/WebPage/ios/WebPageIOS.mm:
3676         (WebKit::WebPage::syncApplyAutocorrection):
3677
3678 2016-10-28  Megan Gardner  <megan_gardner@apple.com>
3679
3680         Rename SharedMemoryMac to SharedMemoryCocoa
3681         https://bugs.webkit.org/show_bug.cgi?id=164156
3682
3683         Reviewed by Alex Christensen.
3684
3685         Renamed SharedMemoryMac to SharedMemoryCocoa, as it runs on all cocoa platforms, not exclusively just mac, and
3686         thus should be named to reflect that reality.
3687
3688         * Platform/cocoa: Added.
3689         * Platform/cocoa/SharedMemoryCocoa.cpp: Copied from Source/WebKit2/Platform/mac/SharedMemoryMac.cpp.
3690         * Platform/mac/SharedMemoryMac.cpp: Removed.
3691         * WebKit2.xcodeproj/project.pbxproj:
3692
3693 2016-10-28  Antti Koivisto  <antti@apple.com>
3694
3695         Enable CFNetwork connection cache fast lane for WebKit2
3696         https://bugs.webkit.org/show_bug.cgi?id=164129
3697
3698         Reviewed by Andreas Kling.
3699
3700         The idea of this feature is keep a connection free for higher priority requests so low-priority
3701         image loads can't take all the available connections.
3702
3703         We have this enabled on WK1 but not on WK2. See what enabling it does for performance in bots.
3704
3705         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3706         (WebKit::initializeNetworkSettings):
3707
3708             Based on code inspection setting kHTTPMinimumFastLanePriority is not sufficient to enable this feature,
3709             kHTTPNumFastLanes needs also be set to a non-zero value. Use the same constants as WK1.
3710             Also enable this on Mac to unify behavior.
3711
3712 2016-10-27  Michael Catanzaro  <mcatanzaro@igalia.com>
3713
3714         [GTK] New stable DOM API headers should be included from webkitdom.h
3715         https://bugs.webkit.org/show_bug.cgi?id=164069
3716
3717         Reviewed by Carlos Garcia Campos.
3718
3719         * WebProcess/InjectedBundle/API/gtk/DOM/webkitdom.h:
3720
3721 2016-10-27  Simon Fraser  <simon.fraser@apple.com>
3722
3723         Fix when building against the MacOSX10.12.sdk where "macos" is not recognized
3724         in the availability macros.
3725
3726         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3727
3728 2016-10-27  Megan Gardner  <megan_gardner@apple.com>
3729
3730         Add support for wide gamut for ShareableBitmap for image popovers
3731         https://bugs.webkit.org/show_bug.cgi?id=164001
3732
3733         Reviewed by Simon Fraser.
3734
3735         Added suppport for wide gamut in ShareableBitmap. SharableBitmaps now know the size of their pixels,
3736         and that data is passed back and forth between the processes. The callers of SharedBitmap will determine
3737         if their image should support wide gamut, but ShareableBitmap will override a set flag on a device that
3738         is incapbable of supporting a wide gamut image.
3739         This makes it possible to show wide gamut images in image popovers on iOS.
3740         This is currently untestable, so no tests added.
3741
3742         * Platform/IPC/Decoder.cpp:
3743         (IPC::Decoder::decode):
3744         * Platform/IPC/Decoder.h:
3745         * Platform/IPC/Encoder.cpp:
3746         (IPC::Encoder::encode):
3747         * Platform/IPC/Encoder.h:
3748         * Shared/ShareableBitmap.cpp:
3749         (WebKit::bytesPerPixel):
3750         (WebKit::ShareableBitmap::Handle::encode):
3751         (WebKit::ShareableBitmap::Handle::decode):
3752         (WebKit::ShareableBitmap::Handle::clear):
3753         (WebKit::ShareableBitmap::create):
3754         (WebKit::ShareableBitmap::createShareable):
3755         (WebKit::ShareableBitmap::createHandle):
3756         (WebKit::ShareableBitmap::ShareableBitmap):
3757         * Shared/ShareableBitmap.h:
3758         (WebKit::ShareableBitmap::numBytesForSize):
3759         (WebKit::ShareableBitmap::sizeInBytes):
3760         * Shared/cg/ShareableBitmapCG.cpp:
3761         (WebKit::bitmapInfo):
3762         (WebKit::ShareableBitmap::createGraphicsContext):
3763         (WebKit::ShareableBitmap::createCGImage):
3764         * WebProcess/WebPage/ios/WebPageIOS.mm:
3765         (WebKit::WebPage::getPositionInformation):
3766
3767 2016-10-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3768
3769         Support "insertFromDrop" and "deleteByDrag" for the InputEvent spec
3770         https://bugs.webkit.org/show_bug.cgi?id=163948
3771         <rdar://problem/28921433>
3772
3773         Reviewed by Darin Adler.
3774
3775         Add support for new drag and drop-related EditAction enum values.
3776
3777         * UIProcess/WebEditCommandProxy.cpp:
3778         (WebKit::WebEditCommandProxy::nameForEditAction):
3779
3780 2016-10-26  Chris Dumez  <cdumez@apple.com>
3781
3782         Replace IDBKeyPath with a WTF::Variant
3783         https://bugs.webkit.org/show_bug.cgi?id=163909
3784
3785         Reviewed by Darin Adler.
3786
3787         Add coders to encode / decode IDBKeyPath type for IPC.
3788
3789         * Shared/Databases/IndexedDB/WebIDBResult.cpp:
3790         * Shared/WebCoreArgumentCoders.cpp:
3791         (IPC::ArgumentCoder<IDBKeyPath>::encode):
3792         (IPC::ArgumentCoder<IDBKeyPath>::decode):
3793         * Shared/WebCoreArgumentCoders.h:
3794         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3795
3796 2016-10-26  Brian Burg  <bburg@apple.com>
3797
3798         Web Inspector: remove unused bool return value from FrontendChannel::sendMessageToFrontend
3799         https://bugs.webkit.org/show_bug.cgi?id=164046
3800
3801         Reviewed by Joseph Pecoraro.
3802
3803         * WebProcess/WebPage/WebInspector.cpp:
3804         (WebKit::WebInspector::sendMessageToFrontend):
3805         * WebProcess/WebPage/WebInspector.h:
3806
3807 2016-10-26  Eric Carlson  <eric.carlson@apple.com>
3808
3809         [MediaStream] Add "has capture device" bit to media state flags
3810         https://bugs.webkit.org/show_bug.cgi?id=163952
3811
3812         Unreviewed fix after r207839.
3813
3814         * WebProcess/WebPage/WebPage.cpp:
3815         (WebKit::WebPage::setMuted): Take an MutedStateFlags, not a bool.
3816         * WebProcess/WebPage/WebPage.h:
3817
3818 2016-10-26  Carlos Garcia Campos  <cgarcia@igalia.com>
3819
3820         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.1 release.
3821
3822         * gtk/NEWS: Add release notes for 2.15.1.
3823
3824 2016-10-26  Carlos Garcia Campos  <cgarcia@igalia.com>
3825
3826         REGRESSION(r206505) [GTK] Build broken with GTK+ 3.14
3827         https://bugs.webkit.org/show_bug.cgi?id=162776
3828
3829         Reviewed by Xabier Rodriguez-Calvar.
3830
3831         Do not use gtk_widget_get_action_group() when GTK+ < 3.16, use g_object_set instead to attach the action group
3832         to the menu widget.
3833
3834         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
3835         (WebKit::WebContextMenuProxyGtk::append):
3836         (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
3837         (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk):
3838
3839 2016-10-25  Alex Christensen  <achristensen@webkit.org>
3840
3841         CMake build fix.
3842
3843         * PlatformMac.cmake:
3844         * Shared/WebHitTestResultData.cpp:
3845         (WebKit::WebHitTestResultData::WebHitTestResultData):
3846         Explicitly call AtomicString::string to make the String constructor no longer ambiguous.
3847         It couldn't decide whether to use operator const String& or operator NSString*.
3848
3849 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3850
3851         [SOUP] Network process assertion in NetworkDataTask::continueHTTPRedirection
3852         https://bugs.webkit.org/show_bug.cgi?id=163941
3853
3854         Reviewed by Michael Catanzaro.
3855
3856         equalLettersIgnoringASCIICase() expects the second argument to be the letters to compare in lowercase, so use
3857         "get" instead of "GET".
3858
3859         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3860         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
3861
3862 2016-10-25  Eric Carlson  <eric.carlson@apple.com>
3863
3864         [MediaStream] Add "has capture device" bit to media state flags
3865         https://bugs.webkit.org/show_bug.cgi?id=163952
3866
3867         Reviewed by Sam Weinig.
3868
3869         * UIProcess/API/C/WKPage.cpp:
3870         (WKPageGetMediaState): Support MediaProducer::HasMediaCaptureDevice.
3871         * UIProcess/API/C/WKPagePrivate.h: Define kWKMediaHasCaptureDevice.
3872
3873 2016-10-25  Commit Queue  <commit-queue@webkit.org>
3874
3875         Unreviewed, rolling out r207827 and r207828.
3876         https://bugs.webkit.org/show_bug.cgi?id=163965
3877
3878         Caused LayoutTest webaudio/web-audio-is-playing.html to time
3879         out on macOS. (Requested by ryanhaddad on #webkit).
3880
3881         Reverted changesets:
3882
3883         "[MediaStream] Add "has capture device" bit to media state
3884         flags"
3885         https://bugs.webkit.org/show_bug.cgi?id=163952
3886         http://trac.webkit.org/changeset/207827
3887
3888         "[MediaStream] Add "has capture device" bit to media state
3889         flags"
3890         https://bugs.webkit.org/show_bug.cgi?id=163952
3891         http://trac.webkit.org/changeset/207828
3892
3893 2016-10-25  Eric Carlson  <eric.carlson@apple.com>
3894
3895         [MediaStream] Add "has capture device" bit to media state flags
3896         https://bugs.webkit.org/show_bug.cgi?id=163952
3897
3898         Reviewed by Sam Weinig.
3899
3900         * UIProcess/API/C/WKPage.cpp:
3901         (WKPageGetMediaState): Support MediaProducer::HasMediaCaptureDevice.
3902         * UIProcess/API/C/WKPagePrivate.h: Define kWKMediaHasCaptureDevice.
3903
3904 2016-10-25  Chris Dumez  <cdumez@apple.com>
3905
3906         Unreviewed, rolling out r207494.
3907
3908         iOS SDK has been updated on the bots now so rollout the
3909         rollout
3910
3911         Reverted changeset:
3912
3913         "Unreviewed, rolling out r207413."
3914         https://bugs.webkit.org/show_bug.cgi?id=163547
3915         http://trac.webkit.org/changeset/207494
3916
3917 2016-10-25  Jonathan Bedard  <jbedard@apple.com>
3918
3919         Unreviewed build fix.
3920
3921         * UIProcess/API/Cocoa/WKWebView.mm:
3922         (-[WKWebView _fullscreenDelegate]): Removed unneeded parenthesis.
3923
3924 2016-10-19  Jer Noble  <jer.noble@apple.com>
3925
3926         Add WKWebView fullscreen delegate SPI
3927         https://bugs.webkit.org/show_bug.cgi?id=163674
3928
3929         Reviewed by Anders Carlsson.
3930
3931         Add a new SPI property to WKWebView allowing clients to be notified when fullscreen mode enters and exits.
3932
3933         * UIProcess/API/APIFullscreenClient.h: Added.
3934         (API::FullscreenClient::~FullscreenClient):
3935         (API::FullscreenClient::willEnterFullscreen):
3936         (API::FullscreenClient::didEnterFullscreen):
3937         (API::FullscreenClient::willExitFullscreen):
3938         (API::FullscreenClient::didExitFullscreen):
3939         * UIProcess/API/Cocoa/WKWebView.mm:
3940         (-[WKWebView _initializeWithConfiguration:]):
3941         (-[WKWebView _setFullscreenDelegate:]):
3942         (-[WKWebView _fullscreenDelegate]):
3943         (-[WKWebView _isInFullscreen]):
3944         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3945         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h: Added.
3946         * UIProcess/Cocoa/FullscreenClient.h: Added.
3947         (WebKit::FullscreenClient::~FullscreenClient):
3948         * UIProcess/Cocoa/FullscreenClient.mm: Added.
3949         (WebKit::FullscreenClient::FullscreenClient):
3950         (WebKit::FullscreenClient::delegate):
3951         (WebKit::FullscreenClient::setDelegate):
3952         (WebKit::FullscreenClient::willEnterFullscreen):
3953         (WebKit::FullscreenClient::didEnterFullscreen):
3954         (WebKit::FullscreenClient::willExitFullscreen):
3955         (WebKit::FullscreenClient::didExitFullscreen):
3956         * UIProcess/WebFullScreenManagerProxy.cpp:
3957         (WebKit::WebFullScreenManagerProxy::willEnterFullScreen):
3958         (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
3959         (WebKit::WebFullScreenManagerProxy::willExitFullScreen):
3960         (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
3961         * UIProcess/WebPageProxy.cpp:
3962         (WebKit::WebPageProxy::WebPageProxy):
3963         (WebKit::WebPageProxy::setFullscreenClient):
3964         (WebKit::WebPageProxy::fullScreenManager): Deleted.
3965         * UIProcess/WebPageProxy.h:
3966         (WebKit::WebPageProxy::fullscreenClient):
3967         * WebKit2.xcodeproj/project.pbxproj:
3968
3969 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3970
3971         Unreviewed. Fix timeouts in 12 GTK+ unit tests after r207812.<