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