2392231522822bceda58039e101689471214e8e6
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-06-28  Alex Christensen  <achristensen@webkit.org>
2
3         Prevent displaying URLs with small capital letters
4         https://bugs.webkit.org/show_bug.cgi?id=173949
5         <rdar://problem/32952058>
6
7         Reviewed by Brent Fulgham.
8
9         Covered by new API tests.
10
11         * platform/mac/WebCoreNSURLExtras.mm:
12         (WebCore::isLookalikeCharacter):
13
14 2017-06-28  Youenn Fablet  <youenn@apple.com>
15
16         Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
17         https://bugs.webkit.org/show_bug.cgi?id=169389
18
19         Reviewed by Alex Christensen.
20
21         Covered by manual testing (appr.tc and https://youennf.github.io/webrtc-tests/src/content/peerconnection/trickle-ice/).
22         Previously, we were creating a libwebrtc peer connection and then setting its configuration.
23         libwebrtc does not like the configuration to be changed and may refuse to set the configuration.
24         Instead of doing that, we are now creating the libwebrtc peer connection with the provided configuration.
25
26         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
27         (WebCore::MediaEndpointPeerConnection::setConfiguration):
28         * Modules/mediastream/MediaEndpointPeerConnection.h:
29         * Modules/mediastream/PeerConnectionBackend.h:
30         * Modules/mediastream/RTCPeerConnection.cpp:
31         (WebCore::RTCPeerConnection::initializeWith):
32         (WebCore::iceServersFromConfiguration):
33         (WebCore::RTCPeerConnection::initializeConfiguration):
34         (WebCore::RTCPeerConnection::setConfiguration):
35         * Modules/mediastream/RTCPeerConnection.h:
36         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
37         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
38         (WebCore::LibWebRTCMediaEndpoint::setConfiguration):
39         (WebCore::LibWebRTCMediaEndpoint::stop):
40         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
41         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
42         (WebCore::configurationFromMediaEndpointConfiguration):
43         (WebCore::LibWebRTCPeerConnectionBackend::setConfiguration):
44         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
45         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
46         (WebCore::createActualPeerConnection):
47         (WebCore::LibWebRTCProvider::createPeerConnection):
48         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
49
50 2017-06-28  Brent Fulgham  <bfulgham@apple.com>
51
52         Teach ResourceLoadStatistics to recognize changes in the file system
53         https://bugs.webkit.org/show_bug.cgi?id=173800
54         <rdar://problem/32937842>
55
56         Reviewed by Chris Dumez.
57
58         We want to support the case where multiple UI processes choose to share the same
59         statistics file. To support this, update the ResourceLoadStatistics logic to be aware
60         that the statistics data file might change underneath it, and to take appropriate
61         action when it does.
62
63         * WebCore.xcodeproj/project.pbxproj: Update for new sources.
64         * WebCore/CMakeLists.txt: Update for new FileMonitor source file.
65         * loader/ResourceLoadStatisticsStore.cpp:
66         (WebCore::ResourceLoadStatisticsStore::clearInMemoryAndPersistent): Use the new deletion
67         handler for the data file instead of writing out an empty file.
68         (WebCore::ResourceLoadStatisticsStore::setDeletePersistentStoreCallback): Added.
69         * loader/ResourceLoadStatisticsStore.h:
70         * platform/FileMonitor.cpp: Added.
71         (WebCore::FileMonitor::create):
72         (WebCore::FileMonitor::FileMonitor): Register handlers and begin monitoring file.
73         (WebCore::FileMonitor::~FileMonitor): Stop any active file monitoring.
74         (WebCore::FileMonitor::startMonitoringPath): Stub implementation.
75         (WebCore::FileMonitor::stopMonitoring): Ditto.
76         * platform/FileMonitor.h: Added.
77         * platform/FileSystem.h: Export files needed by WebKit2. Add support for O_EVTONLY
78         Darwin file handles.
79         * platform/Logging.h: Add 'ResourceLoadStatistics' category.
80         * platform/cocoa/FileMonitorCocoa.mm: Added.
81         (WebCore::FileMonitor::startMonitoringPath): Create a new VNODE type dispatch_source
82         to receive notifications when the specified file changes.
83         (WebCore::FileMonitor::stopMonitoring): Cancel the dispatch_source when we are done
84         monitoring the file.
85         * platform/posix/FileSystemPOSIX.cpp: Update 'openFile' to understand the O_EVTONLY
86         mode of file handles (Darwin-only). 
87
88 2017-06-28  Brady Eidson  <beidson@apple.com>
89
90         DocumentLoader should always notify the client if there are pending icon loads when the load is stopped.
91         https://bugs.webkit.org/show_bug.cgi?id=173874
92
93         Reviewed by Alex Christensen.
94
95         Covered by API tests.
96
97         Patch started by Carlos Garcia Campos, finished by me.
98         
99         * loader/DocumentLoader.cpp:
100         (WebCore::DocumentLoader::stopLoading): Make all of the callbacks for cancelled IconLoaders.
101         (WebCore::DocumentLoader::didGetLoadDecisionForIcon): Make the callback even if there's no IconLoader.
102         (WebCore::DocumentLoader::finishedLoadingIcon):
103         (WebCore::DocumentLoader::notifyFinishedLoadingIcon):
104         * loader/DocumentLoader.h:
105
106 2017-06-28  Antoine Quint  <graouts@apple.com>
107
108         Volume controls should be hidden when AirPlay is active
109         https://bugs.webkit.org/show_bug.cgi?id=173933
110         <rdar://problem/33011931>
111
112         Reviewed by Dean Jackson.
113
114         Ensure we don't show any volume controls during AirPlay. We set the mute button's enabled state to "false"
115         when AirPlay is active and key off this enabled stated to control the display of all volume-related controls
116         throughout the UI.
117
118         Tests: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-volume-controls-hidden-when-mute-button-disabled.html
119                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-top-right-controls-bar-hidden-when-mute-button-disabled.html
120
121         * Modules/modern-media-controls/controls/inline-media-controls.js:
122         (InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
123         (InlineMediaControls):
124         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
125         (MacOSFullscreenMediaControls.prototype.layout):
126         * Modules/modern-media-controls/media/airplay-support.js:
127         (AirplaySupport.prototype.syncControl):
128         (AirplaySupport):
129
130 2017-06-28  Konstantin Tokarev  <annulen@yandex.ru>
131
132         Remove excessive includes from WebCore/css sources
133         https://bugs.webkit.org/show_bug.cgi?id=173919
134
135         Reviewed by Simon Fraser.
136
137         No new tests needed.
138
139         * css/CSSCanvasValue.cpp:
140         * css/CSSComputedStyleDeclaration.cpp:
141         * css/CSSContentDistributionValue.cpp:
142         * css/CSSCrossfadeValue.cpp:
143         * css/CSSCursorImageValue.cpp:
144         * css/CSSCustomPropertyValue.cpp:
145         * css/CSSDefaultStyleSheets.cpp:
146         * css/CSSFilterImageValue.cpp:
147         * css/CSSFontFace.cpp:
148         * css/CSSFontFaceSet.cpp:
149         * css/CSSFontFaceSource.cpp:
150         * css/CSSFontFaceSrcValue.cpp:
151         * css/CSSFontFeatureValue.cpp:
152         * css/CSSFontSelector.cpp:
153         * css/CSSFontValue.cpp:
154         * css/CSSImageGeneratorValue.cpp:
155         * css/CSSImageSetValue.cpp:
156         * css/CSSImageValue.cpp:
157         * css/CSSImportRule.cpp:
158         * css/CSSKeyframesRule.cpp:
159         * css/CSSMediaRule.cpp:
160         * css/CSSNamedImageValue.cpp:
161         * css/CSSPrimitiveValue.cpp:
162         * css/CSSProperty.cpp:
163         * css/CSSPropertySourceData.cpp:
164         * css/CSSReflectValue.cpp:
165         * css/CSSRuleList.cpp:
166         * css/CSSSegmentedFontFace.cpp:
167         * css/CSSSelector.cpp:
168         * css/CSSStyleRule.cpp:
169         * css/CSSStyleSheet.cpp:
170         * css/CSSSupportsRule.cpp:
171         * css/CSSToStyleMap.cpp:
172         * css/CSSValueList.cpp:
173         * css/CSSValuePool.cpp:
174         * css/CSSVariableData.cpp:
175         * css/ElementRuleCollector.cpp:
176         * css/InspectorCSSOMWrappers.cpp:
177         * css/MediaList.cpp:
178         * css/MediaQueryEvaluator.cpp:
179         * css/MediaQueryExpression.cpp:
180         * css/PropertySetCSSStyleDeclaration.cpp:
181         * css/RGBColor.cpp:
182         * css/SelectorChecker.cpp:
183         * css/StyleProperties.cpp:
184         * css/StyleResolver.cpp:
185         * css/StyleRule.cpp:
186         * css/StyleSheetContents.cpp:
187         * css/TransformFunctions.cpp:
188         * css/ViewportStyleResolver.cpp:
189         * css/WebKitCSSRegionRule.cpp:
190         * css/parser/CSSParser.cpp:
191         * css/parser/CSSParserFastPaths.cpp:
192         * css/parser/CSSParserIdioms.cpp:
193         * css/parser/CSSParserSelector.cpp:
194         * css/parser/CSSParserToken.cpp:
195         * css/parser/CSSPropertyParser.cpp:
196         * css/parser/CSSSelectorParser.cpp:
197         * css/parser/MediaQueryParser.cpp:
198
199 2017-06-28  Alex Christensen  <achristensen@webkit.org>
200
201         Fix CMake build.
202
203         * PlatformMac.cmake:
204
205 2017-06-28  Antoine Quint  <graouts@apple.com>
206
207         Remove unnecessary `const double` method arguments
208         https://bugs.webkit.org/show_bug.cgi?id=173925
209
210         Reviewed by Dean Jackson.
211
212         Addressing post-landing feedback from webkit.org/b/173858.
213
214         * Modules/mediacontrols/MediaControlsHost.cpp:
215         (WebCore::MediaControlsHost::formattedStringForDuration):
216         * Modules/mediacontrols/MediaControlsHost.h:
217         * rendering/RenderTheme.h:
218         (WebCore::RenderTheme::mediaControlsFormattedStringForDuration):
219         * rendering/RenderThemeCocoa.h:
220
221 2017-06-28  Zalan Bujtas  <zalan@apple.com>
222
223         Unreviewed, rolling out r218373.
224
225         Output is not right
226
227         Reverted changeset:
228
229         "Use WTFLogAlways for debug logging so that it shows up in
230         device system logs"
231         https://bugs.webkit.org/show_bug.cgi?id=173450
232         http://trac.webkit.org/changeset/218373
233
234 2017-06-28  Carlos Garcia Campos  <cgarcia@igalia.com>
235
236         [GTK] Some web pages disappear immediately after rendering
237         https://bugs.webkit.org/show_bug.cgi?id=173768
238
239         Reviewed by Xabier Rodriguez-Calvar.
240
241         This is happening with websites having a "hidden" class in HTML tag when a media element is added. In the GTK+
242         port the media controls CSS contains the following code:
243
244         .hidden {
245             display: none !important;
246         }
247
248         That causes the whole HTML document to become display: none. That's why we just render a white page, and also
249         the reason why it only happens with the GTK+ port and only with some specific websites. We should limit the
250         scope of the hidden class to the media control elements.
251
252         * css/mediaControlsGtk.css:
253         (audio::-webkit-media-controls-panel.hidden,):
254         (audio::-webkit-media-controls-panel div.mute-box.hidden,):
255         (audio::-webkit-media-controls-current-time-display.hidden,):
256         (audio::-webkit-media-controls-timeline.hidden,):
257         (audio::-webkit-media-controls-toggle-closed-captions-button, video::-webkit-media-controls-toggle-closed-captions-button):
258         (audio::-webkit-media-controls-toggle-closed-captions-button.hidden,):
259         (video::-webkit-media-controls-closed-captions-container.hidden):
260         (audio::-webkit-media-controls-fullscreen-button.hidden,):
261         (.hidden): Deleted.
262
263 2017-06-28  Antoine Quint  <graouts@apple.com>
264
265         Media controls volume glyph does not have the correct material
266         https://bugs.webkit.org/show_bug.cgi?id=173918
267         <rdar://problem/33012697>
268
269         Reviewed by Eric Carlson.
270
271         Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-mute-button-in-bottom-or-top-right-controls-bar.html
272
273         All buttons were hosted in a ControlsBar save for the MuteButton, so we now host it in a controls bar as well
274         to ensure compositing is similar to all other buttons.
275
276         * Modules/modern-media-controls/controls/inline-media-controls.css:
277         (.media-controls.inline > .controls-bar.top-right):
278         (.media-controls.inline > button.mute): Deleted.
279         * Modules/modern-media-controls/controls/inline-media-controls.js:
280         (InlineMediaControls):
281         (InlineMediaControls.prototype.layout):
282         (InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
283         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
284         (MacOSInlineMediaControls.prototype.handleEvent):
285
286 2017-06-28  Carlos Garcia Campos  <cgarcia@igalia.com>
287
288         REGRESSION(r218799): [GTK][WPE] Critical warning at exit
289         https://bugs.webkit.org/show_bug.cgi?id=173907
290
291         Reviewed by Konstantin Tokarev.
292
293         GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
294
295         This is now always happening when closing the MeiniBrowser and it's causing a lot of unit tests to fail. In
296         r218799, GRefPtrGtk.h include was removed from PasteboardHelper.h that contains a GRefPtr<GtkTargetList>. The
297         targets are destroyed at exit, but now trying to use g_object_unref instead of gtk_target_list_unref(). I've
298         found two more cases like this in r218799, that removes GUniquePtrSoup.h from ResourceHandleInternal.h and
299         ResourceRequest.h that have GUniquePtr<SoupBuffer> and GUniquePtr<SoupURI>.
300
301         Fixes several GTK+ and WPE unit tests.
302
303         * platform/gtk/PasteboardHelper.h: Bring back GRefPtrGtk.h.
304         * platform/network/ResourceHandleInternal.h: Bring back GUniquePtrSoup.h.
305         * platform/network/soup/ResourceRequest.h: Ditto.
306
307 2017-06-27  Chris Dumez  <cdumez@apple.com>
308
309         [ResourceLoadStatistics] Update minimumTimeBetweeenDataRecordsRemoval to 1 hour instead of 1 minute
310         https://bugs.webkit.org/show_bug.cgi?id=173895
311         <rdar://problem/32984366>
312
313         Reviewed by Brent Fulgham.
314
315         Update minimumTimeBetweeenDataRecordsRemoval to 1 hour instead of 1 minute to save battery.
316         Also port code to modern time types.
317
318         * loader/ResourceLoadObserver.cpp:
319         (WebCore::reduceTimeResolution):
320         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
321         (WebCore::ResourceLoadObserver::setTimeToLiveUserInteraction):
322         (WebCore::ResourceLoadObserver::setTimeToLiveCookiePartitionFree):
323         (WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval):
324         (WebCore::ResourceLoadObserver::setReducedTimestampResolution):
325         (WebCore::ResourceLoadObserver::setGrandfatheringTime):
326         * loader/ResourceLoadObserver.h:
327         * loader/ResourceLoadStatistics.h:
328         (WebCore::ResourceLoadStatistics::mostRecentUserInteractionTime):
329         * loader/ResourceLoadStatisticsStore.cpp:
330         (WebCore::ResourceLoadStatisticsStore::createEncoderFromData):
331         (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
332         (WebCore::shouldPartitionCookies):
333         (WebCore::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
334         (WebCore::ResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
335         (WebCore::ResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval):
336         (WebCore::ResourceLoadStatisticsStore::setGrandfatheringTime):
337         (WebCore::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
338         (WebCore::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
339         (WebCore::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore):
340         (WebCore::ResourceLoadStatisticsStore::shouldRemoveDataRecords):
341         (WebCore::ResourceLoadStatisticsStore::dataRecordsBeingRemoved):
342         * loader/ResourceLoadStatisticsStore.h:
343
344 2017-06-27  Chris Dumez  <cdumez@apple.com>
345
346         Port HysteresisActivity to Seconds type
347         https://bugs.webkit.org/show_bug.cgi?id=173902
348
349         Reviewed by Simon Fraser.
350
351         * platform/HysteresisActivity.h:
352         (WebCore::HysteresisActivity::HysteresisActivity):
353         (WebCore::HysteresisActivity::stop):
354         * platform/ios/WebSQLiteDatabaseTrackerClient.mm:
355
356 2017-06-27  Jeremy Jones  <jeremyj@apple.com>
357
358         MediaPlayerPrivate m_private may not yet be created when setPrivateBrowsingMode is called.
359         https://bugs.webkit.org/show_bug.cgi?id=173893
360         rdar://problem/32986872
361         
362         Reviewed by Ryosuke Niwa.
363
364         No new tests because no reproducable case.
365
366         setPrivateBrowsingMode can be called on MediaPlayer before the MediaPlayerPrivate is created.
367         The value should only be pushed down the m_private if it has been created.
368
369         * platform/graphics/MediaPlayer.cpp:
370         (WebCore::MediaPlayer::setPrivateBrowsingMode):
371
372 2017-06-27  Wenson Hsieh  <wenson_hsieh@apple.com>
373
374         [iOS DnD] Support dragging out of contenteditable areas without a prior selection
375         https://bugs.webkit.org/show_bug.cgi?id=173854
376         <rdar://problem/32236827>
377
378         Reviewed by Ryosuke Niwa and Tim Horton.
379
380         Allows elements to be dragged from contenteditable areas for both WebKit1 and WebKit2 iOS. There are two main
381         changes in WebCore: move the touch point adjustment code into EventHandler::tryToBeginDataInteractionAtPoint, so
382         that the clientPosition specified will be adjusted to an appropriate clickable node if needed. This is necessary
383         because UIWebDocumentView and WKContentView no longer send adjusted points to WebCore when requesting drag
384         start. See <https://bugs.webkit.org/show_bug.cgi?id=173855> for a followup regarding the globalPosition and
385         clientPositions passed in to the MouseEvents when performing a drag or synthetic click.
386
387         Secondly, image elements in Mail's contenteditable area are not draggable unless the heuristic in
388         DragController::draggableElement is tweaked to not reject image dragging across the board if the
389         loadsImagesAutomatically setting is turned off. Instead, even if images are not automatically loaded, allow the
390         image drag to commence if the image renderer already has a cached image.
391
392         Test: DataInteractionTests.DragImageFromContentEditable
393
394         * page/DragController.cpp:
395         (WebCore::imageElementIsDraggable):
396         (WebCore::DragController::draggableElement):
397         * page/ios/EventHandlerIOS.mm:
398         (WebCore::EventHandler::tryToBeginDataInteractionAtPoint):
399
400 2017-06-27  Antoine Quint  <graouts@apple.com>
401
402         [Modern Media Controls] Accessibility labels should be formatted using NSDateComponentsFormatter
403         https://bugs.webkit.org/show_bug.cgi?id=173858
404         <rdar://problem/32643171>
405
406         Reviewed by Dean Jackson.
407
408         We shouldn't be manually trying to create a formatted string for media controls and instead rely
409         on NSDateComponentsFormatter to perform this task for us. So we remove the ad-hoc code in the JS
410         media controls code and instead add a new MediaControlsHost method to format durations which calls
411         into RenderTheme to provide a formatted duration string relevant to the current platform and locale.
412
413         * English.lproj/modern-media-controls-localized-strings.js:
414         * Modules/mediacontrols/MediaControlsHost.cpp:
415         (WebCore::MediaControlsHost::formattedStringForDuration):
416         * Modules/mediacontrols/MediaControlsHost.h:
417         * Modules/mediacontrols/MediaControlsHost.idl:
418         * Modules/modern-media-controls/controls/slider.js:
419         (Slider.prototype.set inputAccessibleLabel):
420         * Modules/modern-media-controls/controls/time-label.js:
421         (TimeLabel.prototype.commitProperty):
422         * Modules/modern-media-controls/main.js:
423         (createControls):
424         (formattedStringForDuration):
425         (formatTimeToString): Deleted.
426         * rendering/RenderTheme.h:
427         (WebCore::RenderTheme::mediaControlsFormattedStringForDuration):
428         * rendering/RenderThemeCocoa.h:
429         * rendering/RenderThemeCocoa.mm:
430         (WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration):
431
432 2017-06-27  Eric Carlson  <eric.carlson@apple.com>
433
434         r218647 causes getUserMedia to fail on some machines
435         https://bugs.webkit.org/show_bug.cgi?id=173894
436
437         Reviewed by Youenn Fablet.
438
439         * platform/mediastream/mac/AVVideoCaptureSource.mm:
440         (WebCore::AVVideoCaptureSource::isFrameRateSupported): Change frame rate epsilon from 0.00001
441         to 0.001.
442
443 2017-06-27  Antoine Quint  <graouts@apple.com>
444
445         Placard icons act like buttons (can get keyboard focus and shows up in VoiceOver)
446         https://bugs.webkit.org/show_bug.cgi?id=173891
447         <rdar://problem/33011855>
448
449         Reviewed by Dean Jackson.
450
451         Ensure that we disable buttons inside placards as they're only decorative and should
452         not be interactive.
453
454         * Modules/modern-media-controls/controls/placard.js:
455         (Placard.):
456
457 2017-06-27  Jeremy Jones  <jeremyj@apple.com>
458
459         Disable m_temporarilyAllowingInlinePlaybackAfterFullscreen on pause
460         https://bugs.webkit.org/show_bug.cgi?id=173843
461         rdar://problem/32982431
462
463         Reviewed by Eric Carlson.
464
465         Test: media/media-fullscreen-pause-inline.html
466
467         Some pages may not have a fullscreen button, so disabled m_temporarilyAllowingInlinePlaybackAfterFullscreen on pause.
468
469         * html/HTMLMediaElement.cpp:
470         (WebCore::HTMLMediaElement::pause):
471
472 2017-06-27  Chris Dumez  <cdumez@apple.com>
473
474         [iOS] Avoid taking / releasing process assertions too quickly due to database activity
475         https://bugs.webkit.org/show_bug.cgi?id=173879
476         <rdar://problem/32412701>
477
478         Reviewed by Antti Koivisto.
479
480         Add HysteresisActivity to WebSQLiteDatabaseTrackerClient to avoid taking / releasing
481         process assertion too quickly due to database activity.
482
483         * platform/ios/WebSQLiteDatabaseTrackerClient.h:
484         * platform/ios/WebSQLiteDatabaseTrackerClient.mm:
485         (WebCore::WebSQLiteDatabaseTrackerClient::WebSQLiteDatabaseTrackerClient):
486         (WebCore::WebSQLiteDatabaseTrackerClient::willBeginFirstTransaction):
487         (WebCore::WebSQLiteDatabaseTrackerClient::didFinishLastTransaction):
488         (WebCore::WebSQLiteDatabaseTrackerClient::hysteresisUpdated):
489
490 2017-06-27  Youenn Fablet  <youenn@apple.com>
491
492         Using public logging for WebRTC release logging
493         https://bugs.webkit.org/show_bug.cgi?id=173881
494
495         Reviewed by Eric Carlson.
496
497         No change of behavior.
498
499         * Modules/mediastream/PeerConnectionBackend.cpp:
500         (WebCore::PeerConnectionBackend::createOfferSucceeded):
501         (WebCore::PeerConnectionBackend::createOfferFailed):
502         (WebCore::PeerConnectionBackend::createAnswerSucceeded):
503         (WebCore::PeerConnectionBackend::createAnswerFailed):
504         (WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
505         (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
506         (WebCore::PeerConnectionBackend::addIceCandidateFailed):
507         (WebCore::PeerConnectionBackend::newICECandidate):
508         * Modules/mediastream/RTCPeerConnection.cpp:
509         (WebCore::RTCPeerConnection::queuedSetLocalDescription):
510         (WebCore::RTCPeerConnection::queuedSetRemoteDescription):
511         (WebCore::RTCPeerConnection::queuedAddIceCandidate):
512         (WebCore::RTCPeerConnection::updateIceGatheringState):
513         (WebCore::RTCPeerConnection::updateIceConnectionState):
514         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
515         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
516
517 2017-06-27  Don Olmstead  <don.olmstead@sony.com>
518
519         [PAL] Add symbol export macros for PAL
520         https://bugs.webkit.org/show_bug.cgi?id=171519
521
522         Reviewed by Konstantin Tokarev.
523
524         No new tests. No change in behavior.
525
526         * CMakeLists.txt:
527         * config.h:
528         * platform/PlatformExportMacros.h:
529
530 2017-06-27  John Wilander  <wilander@apple.com>
531
532         Resource Load Statistics: Add telemetry
533         https://bugs.webkit.org/show_bug.cgi?id=173499
534         <rdar://problem/32826094>
535
536         Reviewed by Brent Fulgham.
537
538         Test: http/tests/loading/resourceLoadStatistics/telemetry-generation.html
539
540         * loader/ResourceLoadObserver.cpp:
541         (WebCore::ResourceLoadObserver::fireTelemetryHandler):
542             Test infrastructure.
543         * loader/ResourceLoadObserver.h:
544         * loader/ResourceLoadStatisticsStore.cpp:
545         (WebCore::ResourceLoadStatisticsStore::setFireTelemetryCallback):
546         (WebCore::ResourceLoadStatisticsStore::fireTelemetryHandler):
547             Test infrastructure.
548         (WebCore::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
549             Convenience function for telemetry.
550         * loader/ResourceLoadStatisticsStore.h:
551             Added struct WebCore::PrevalentResourceTelemetry.
552         * page/DiagnosticLoggingKeys.cpp:
553         (WebCore::DiagnosticLoggingKeys::resourceLoadStatisticsTelemetryKey):
554             Added.
555         * page/DiagnosticLoggingKeys.h:
556
557 2017-06-27  Ting-Wei Lan  <lantw44@gmail.com>
558
559         Add missing includes to fix compilation error on FreeBSD
560         https://bugs.webkit.org/show_bug.cgi?id=172919
561
562         Reviewed by Mark Lam.
563
564         No new tests needed.
565
566         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
567         * platform/audio/ReverbAccumulationBuffer.cpp:
568
569 2017-06-27  Zalan Bujtas  <zalan@apple.com>
570
571         Add RenderEmbeddedObject::getReplacementTextGeometry helper.
572         https://bugs.webkit.org/show_bug.cgi?id=173847
573
574         Reviewed by Simon Fraser.
575
576         ...and remove getReplacementTextGeometry's redundant return value. 
577
578         No change in functionality.
579
580         * rendering/RenderEmbeddedObject.cpp:
581         (WebCore::RenderEmbeddedObject::paintReplaced):
582         (WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
583         (WebCore::RenderEmbeddedObject::unavailablePluginIndicatorBounds):
584         (WebCore::RenderEmbeddedObject::isInUnavailablePluginIndicator):
585         * rendering/RenderEmbeddedObject.h:
586
587 2017-06-27  Wenson Hsieh  <wenson_hsieh@apple.com>
588
589         Refactor drag start codepaths to plumb a DragItem to client layers
590         https://bugs.webkit.org/show_bug.cgi?id=173832
591         Work towards <rdar://problem/32236827>
592
593         Reviewed by Ryosuke Niwa and Tim Horton.
594
595         Refactor drag start logic in WebCore to set up a DragItem and propagate it to WebDragClient. No change in behavior.
596
597         * loader/EmptyClients.cpp:
598         * page/DragClient.h:
599         * page/DragController.cpp:
600         (WebCore::DragController::startDrag):
601         (WebCore::DragController::doImageDrag):
602         (WebCore::DragController::doSystemDrag):
603
604         Refactor to pass along a DragItem. Also, remove unused drag image anchor computation.
605
606         * page/DragController.h:
607         * platform/DragImage.h:
608         * platform/DragItem.h:
609
610         Add additional information needed to begin a drag on iOS.
611
612         (WebCore::DragItem::encode):
613         (WebCore::DragItem::decode):
614
615         Add IPC serialization/deserialization support for DragItem.
616
617         * platform/PasteboardWriterData.cpp:
618         (WebCore::PasteboardWriterData::isEmpty):
619         * platform/PasteboardWriterData.h:
620
621 2017-06-27  Frederic Wang  <fwang@igalia.com>
622
623         Some tests to verify forbidden frame navigation time out
624         https://bugs.webkit.org/show_bug.cgi?id=173657
625
626         Reviewed by Chris Dumez.
627
628         Currently some tests try and perform a forbidden frame navigation and verify the
629         corresponding console error. However, WebKit does not raise any exception for such error so
630         the tests have to wait until the timeout limit to complete, which makes execution slow.
631         This patch modifies the setters of window.location for which such error may happen in order
632         to raise an exception so the tests behave as expected.
633
634         No new tests, already covered by existing tests.
635
636         * page/Location.cpp: Adjust Location::setLocation to return a security exception and pass it
637         to the callers.
638         (WebCore::Location::setHref): Adjust function to possibly return an exception.
639         (WebCore::Location::setProtocol): Ditto.
640         (WebCore::Location::setHost): Ditto.
641         (WebCore::Location::setHostname): Ditto.
642         (WebCore::Location::setPort): Ditto.
643         (WebCore::Location::setPathname): Ditto.
644         (WebCore::Location::setSearch): Ditto.
645         (WebCore::Location::setHash): Ditto.
646         (WebCore::Location::assign): Ditto.
647         (WebCore::Location::setLocation): FrameLoader::findFrameForNavigation is really only used
648         to verify whether navigating m_frame is permitted so it is more simple and clearer to do it
649         directly. When navigation is not permitted, this function now raises a security exception.
650         * page/Location.h: Modify some setters to return an ExceptionOr<void>.
651         * page/Location.idl: Allow some setters to raise an exception.
652
653 2017-06-26  Fujii Hironori  <Hironori.Fujii@sony.com>
654
655         [GTK] Layout Test webrtc/video.html issues "stack smashing detected"
656         https://bugs.webkit.org/show_bug.cgi?id=173862
657
658         Reviewed by Carlos Garcia Campos.
659
660         Tests: webrtc/video.html
661
662         Passing a bool variable to g_object_get causes out-of-bound write.
663         gboolean should be used, which is 4 bytes while bool is one byte.
664
665         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
666         (WebCore::MediaPlayerPrivateGStreamerBase::muted): Use gboolean instead of bool.
667         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
668         (WebCore::MediaPlayerPrivateGStreamerOwr::trackEnded): Ditto.
669
670 2017-06-26  Chris Dumez  <cdumez@apple.com>
671
672         WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains() is inefficient
673         https://bugs.webkit.org/show_bug.cgi?id=173850
674
675         Reviewed by Ryosuke Niwa.
676
677         * loader/ResourceLoadStatisticsStore.cpp:
678         (WebCore::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords):
679         * loader/ResourceLoadStatisticsStore.h:
680
681 2017-06-26  Antti Koivisto  <antti@apple.com>
682
683         REGRESSION (AsyncImageDecoding): A tab with the WWDC keynote paused is killed for using excessive power (Image thrashing)
684         https://bugs.webkit.org/show_bug.cgi?id=173804
685         <rdar://problem/32623745>
686
687         Reviewed by Simon Fraser.
688
689         When under memory pressure MemoryCache::singleton().pruneLiveResources(true) is called inFrameView::didPaintContents()
690         after top level paint. We end up decoding and pruning bitmaps repeatedly for each tile, which is not great.
691
692         Situation gets worse with async decoding. Painting now doesn’t actually decode the image, it just starts the decoding.
693         When it completes we trigger another paint to get the bits to the tiles. The paint for the first tile then calls
694         pruneLiveResources and loses the bitmap and the second tile triggers another round of async decoding. We have code
695         that prevents pruning of visible images but non-visible images in tiling area can hit this bug easily.
696
697         Test: fast/images/low-memory-decode.html
698
699         * page/FrameView.cpp:
700         (WebCore::FrameView::willPaintContents):
701         (WebCore::FrameView::didPaintContents):
702
703             Eliminate synchronous pruning during painting. This is an obsolete mechanism from early iOS times.
704
705         * platform/graphics/BitmapImage.cpp:
706         (WebCore::BitmapImage::imageFrameAvailableAtIndex):
707         (WebCore::BitmapImage::decodeCountForTesting):
708
709             Testing support.
710
711         * platform/graphics/BitmapImage.h:
712         * testing/Internals.cpp:
713         (WebCore::Internals::imageDecodeCount):
714         * testing/Internals.h:
715         * testing/Internals.idl:
716
717 2017-06-26  Chris Dumez  <cdumez@apple.com>
718
719         ImageFrameCache::startAsyncDecodingQueue() unsafely passes Strings across threads
720         https://bugs.webkit.org/show_bug.cgi?id=173842
721
722         Reviewed by Simon Fraser.
723
724         The URL string was passed across thread without isolated copy.
725
726         * platform/graphics/ImageFrameCache.cpp:
727         (WebCore::ImageFrameCache::startAsyncDecodingQueue):
728
729 2017-06-26  Jonathan Bedard  <jbedard@apple.com>
730
731         Unreviewed, rolling out r218783.
732
733         Causing accessibility/mac/setting-attributes-is-
734         asynchronous.html to crash consistently on mac-wk2 Debug
735
736         Reverted changeset:
737
738         "AX: Cannot call setValue() on contenteditable or ARIA text
739         controls"
740         https://bugs.webkit.org/show_bug.cgi?id=173520
741         http://trac.webkit.org/changeset/218783
742
743 2017-06-26  Yusuke Suzuki  <utatane.tea@gmail.com>
744
745         [WTF] Drop Thread::create(obsolete things) API since we can use lambda
746         https://bugs.webkit.org/show_bug.cgi?id=173825
747
748         Reviewed by Saam Barati.
749
750         No behavior change.
751
752         * Modules/indexeddb/server/IDBServer.cpp:
753         (WebCore::IDBServer::IDBServer::IDBServer):
754         (WebCore::IDBServer::IDBServer::databaseThreadEntry): Deleted.
755         * Modules/indexeddb/server/IDBServer.h:
756         * Modules/webaudio/AsyncAudioDecoder.cpp:
757         (WebCore::AsyncAudioDecoder::AsyncAudioDecoder):
758         (WebCore::AsyncAudioDecoder::threadEntry): Deleted.
759         * Modules/webaudio/AsyncAudioDecoder.h:
760         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
761         (WebCore::OfflineAudioDestinationNode::startRendering):
762         (WebCore::OfflineAudioDestinationNode::offlineRenderEntry): Deleted.
763         * Modules/webaudio/OfflineAudioDestinationNode.h:
764         * Modules/webdatabase/DatabaseThread.cpp:
765         (WebCore::DatabaseThread::start):
766         (WebCore::DatabaseThread::databaseThreadStart): Deleted.
767         * Modules/webdatabase/DatabaseThread.h:
768         * bindings/js/GCController.cpp:
769         (WebCore::collect):
770         (WebCore::GCController::gcTimerFired):
771         (WebCore::GCController::garbageCollectOnAlternateThreadForDebugging):
772         * loader/icon/IconDatabase.cpp:
773         (WebCore::IconDatabase::open):
774         (WebCore::IconDatabase::iconDatabaseSyncThreadStart): Deleted.
775         * loader/icon/IconDatabase.h:
776         * page/ResourceUsageThread.cpp:
777         (WebCore::ResourceUsageThread::createThreadIfNeeded):
778         (WebCore::ResourceUsageThread::threadCallback): Deleted.
779         * page/ResourceUsageThread.h:
780         * page/scrolling/ScrollingThread.cpp:
781         (WebCore::ScrollingThread::createThreadIfNeeded):
782         (WebCore::ScrollingThread::threadCallback): Deleted.
783         (WebCore::ScrollingThread::threadBody): Deleted.
784         * page/scrolling/ScrollingThread.h:
785         * platform/audio/HRTFDatabaseLoader.cpp:
786         (WebCore::HRTFDatabaseLoader::loadAsynchronously):
787         (WebCore::databaseLoaderEntry): Deleted.
788         * platform/audio/HRTFDatabaseLoader.h:
789         * platform/audio/ReverbConvolver.cpp:
790         (WebCore::ReverbConvolver::ReverbConvolver):
791         (WebCore::backgroundThreadEntry): Deleted.
792         * platform/audio/ReverbConvolver.h:
793         (WebCore::ReverbConvolver::useBackgroundThreads):
794         * platform/network/cf/LoaderRunLoopCF.cpp:
795         (WebCore::loaderRunLoop):
796         (WebCore::runLoaderThread): Deleted.
797         * platform/network/curl/CurlManager.cpp:
798         (WebCore::CurlManager::startThreadIfNeeded):
799         (WebCore::CurlManager::workerThread):
800         * platform/network/curl/CurlManager.h:
801         * workers/WorkerThread.cpp:
802         (WebCore::WorkerThread::start):
803         (WebCore::WorkerThread::workerThreadStart): Deleted.
804         * workers/WorkerThread.h:
805
806 2017-06-26  Joanmarie Diggs  <jdiggs@igalia.com>
807
808         [ATK] Add support for aria-details and aria-errormessage
809         https://bugs.webkit.org/show_bug.cgi?id=172588
810
811         Reviewed by Chris Fleizach.
812
813         Add methods to retrieve elements referenced by or referencing the new
814         aria-details and aria-errormessage attributes. Include aria-details and
815         aria-errormessage in AccessibilityObject::supportsARIAAttributes() to ensure
816         elements with these attributes will be included in the accessibility tree.
817
818         New test cases added to accessibility/gtk/relation-types.html.
819
820         * accessibility/AccessibilityObject.cpp:
821         (WebCore::AccessibilityObject::supportsARIAAttributes):
822         (WebCore::AccessibilityObject::ariaDetailsElements):
823         (WebCore::AccessibilityObject::ariaDetailsReferencingElements):
824         (WebCore::AccessibilityObject::ariaErrorMessageElements):
825         (WebCore::AccessibilityObject::ariaErrorMessageReferencingElements):
826         * accessibility/AccessibilityObject.h:
827         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
828         (setAtkRelationSetFromCoreObject):
829         * html/HTMLAttributeNames.in:
830
831 2017-06-26  Konstantin Tokarev  <annulen@yandex.ru>
832
833         Remove excessive headers from WebCore/{Modules,animation,crypto,domjit}
834         https://bugs.webkit.org/show_bug.cgi?id=173824
835
836         Reviewed by Darin Adler.
837
838         No new tests needed.
839
840         * Modules/credentials/CredentialCreationOptions.h:
841         * Modules/credentials/PasswordCredential.h:
842         * Modules/fetch/FetchBody.h:
843         * Modules/fetch/FetchBodyOwner.h:
844         * Modules/gamepad/GamepadManager.h:
845         * Modules/geolocation/Coordinates.h:
846         * Modules/geolocation/Geoposition.h:
847         * Modules/indexeddb/IDBActiveDOMObject.h:
848         * Modules/indexeddb/IDBCursor.h:
849         * Modules/indexeddb/IDBDatabase.h:
850         * Modules/indexeddb/IDBDatabaseIdentifier.h:
851         * Modules/indexeddb/IDBObjectStore.cpp:
852         * Modules/indexeddb/IDBObjectStore.h:
853         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
854         * Modules/indexeddb/server/UniqueIDBDatabase.h:
855         * Modules/indexeddb/shared/InProcessIDBServer.h:
856         * Modules/indexeddb/shared/IndexKey.h:
857         * Modules/mediacontrols/MediaControlsHost.h:
858         * Modules/mediasession/WebMediaSessionManager.h:
859         * Modules/mediasource/SourceBufferList.h:
860         * Modules/mediasource/VideoPlaybackQuality.h:
861         * Modules/notifications/Notification.h:
862         * Modules/quota/WorkerNavigatorStorageQuota.h:
863         * Modules/webaudio/AudioBasicProcessorNode.h:
864         * Modules/webaudio/AudioContext.h:
865         * Modules/webaudio/AudioDestinationNode.h:
866         * Modules/webaudio/AudioParamTimeline.h:
867         * Modules/webaudio/ConvolverNode.cpp:
868         * Modules/webaudio/MediaStreamAudioSource.h:
869         * Modules/webaudio/MediaStreamAudioSourceNode.h:
870         * Modules/webaudio/PannerNode.h:
871         * Modules/webaudio/PeriodicWave.h:
872         * Modules/webaudio/ScriptProcessorNode.h:
873         * Modules/webdatabase/DatabaseManager.h:
874         * Modules/webdatabase/DatabaseTask.h:
875         * Modules/webdatabase/SQLTransaction.h:
876         * Modules/webdatabase/SQLTransactionBackend.h:
877         * Modules/webdatabase/SQLTransactionStateMachine.h:
878         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
879         * Modules/websockets/WebSocketDeflater.h:
880         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
881         * animation/AnimationEffect.h:
882         * crypto/CryptoKeyPair.h:
883         * crypto/parameters/CryptoAlgorithmEcdhKeyDeriveParams.h:
884         * dom/ScriptExecutionContext.h:
885         * domjit/DOMJITHelpers.h:
886         * domjit/DOMJITIDLConvert.h:
887         * domjit/DOMJITIDLType.h:
888
889 2017-06-26  Konstantin Tokarev  <annulen@yandex.ru>
890
891         [GTK] Unreviewed, added missing includes to fix debug build
892
893         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
894
895 2017-06-25  Konstantin Tokarev  <annulen@yandex.ru>
896
897         Remove excessive headers from WebCore/platform
898         https://bugs.webkit.org/show_bug.cgi?id=173822
899
900         Reviewed by Tim Horton.
901
902         No new tests needed.
903
904         * html/ColorInputType.h:
905         * html/MediaElementSession.h:
906         * page/SecurityOriginData.cpp:
907         * platform/CalculationValue.cpp:
908         * platform/CalculationValue.h:
909         * platform/ColorChooserClient.h:
910         * platform/ContentType.h:
911         * platform/LogMacros.h:
912         * platform/PODRedBlackTree.h:
913         * platform/PasteboardStrategy.h:
914         * platform/PlatformPasteboard.h:
915         * platform/PopupMenuStyle.h:
916         * platform/ScrollAnimator.h:
917         * platform/Theme.h:
918         * platform/ThreadGlobalData.h:
919         * platform/animation/AnimationList.h:
920         * platform/audio/AudioArray.h:
921         * platform/audio/AudioChannel.h:
922         * platform/audio/DynamicsCompressor.h:
923         * platform/audio/DynamicsCompressorKernel.h:
924         * platform/audio/FFTFrame.h:
925         * platform/audio/HRTFDatabaseLoader.cpp:
926         * platform/audio/HRTFDatabaseLoader.h:
927         * platform/audio/HRTFElevation.h:
928         * platform/audio/MultiChannelResampler.h:
929         * platform/audio/PlatformMediaSession.h:
930         * platform/audio/ReverbConvolver.h:
931         * platform/audio/ReverbConvolverStage.cpp:
932         * platform/graphics/ANGLEWebKitBridge.h:
933         * platform/graphics/BitmapImage.h:
934         * platform/graphics/CrossfadeGeneratedImage.h:
935         * platform/graphics/FloatPolygon.h:
936         * platform/graphics/FloatSizeHash.h:
937         * platform/graphics/Font.h:
938         * platform/graphics/FontMetrics.h:
939         * platform/graphics/FontPlatformData.h:
940         * platform/graphics/FontRanges.h:
941         * platform/graphics/FontTaggedSettings.h:
942         * platform/graphics/GraphicsContext3D.h:
943         * platform/graphics/GraphicsContext3DPrivate.h:
944         * platform/graphics/GraphicsLayerClient.h:
945         * platform/graphics/Image.cpp:
946         * platform/graphics/ImageFrame.h:
947         * platform/graphics/ImageFrameCache.h:
948         * platform/graphics/ImageSource.h:
949         * platform/graphics/IntRectHash.h:
950         * platform/graphics/IntSizeHash.h:
951         * platform/graphics/MediaPlaybackTargetClient.h:
952         * platform/graphics/Pattern.h:
953         * platform/graphics/PlatformTimeRanges.h:
954         * platform/graphics/TextRun.h:
955         * platform/graphics/TiledBacking.h:
956         * platform/graphics/cairo/FontCustomPlatformData.h:
957         * platform/graphics/filters/FEConvolveMatrix.h:
958         * platform/graphics/filters/FELighting.h:
959         * platform/graphics/filters/SourceAlpha.h:
960         * platform/graphics/gstreamer/GStreamerUtilities.h:
961         * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
962         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
963         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
964         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
965         * platform/graphics/harfbuzz/HarfBuzzShaper.h:
966         * platform/graphics/opengl/Extensions3DOpenGL.h:
967         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
968         * platform/graphics/texmap/TextureMapperBackingStore.h:
969         * platform/graphics/texmap/TextureMapperGL.cpp:
970         * platform/graphics/texmap/TextureMapperGL.h:
971         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
972         * platform/graphics/texmap/TextureMapperTile.h:
973         * platform/graphics/texmap/coordinated/Tile.h:
974         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
975         * platform/graphics/transforms/TransformState.h:
976         * platform/gtk/PasteboardHelper.h:
977         * platform/gtk/ScrollbarThemeGtk.h:
978         * platform/image-decoders/ImageDecoder.h:
979         * platform/network/BlobData.h:
980         * platform/network/BlobDataFileReference.h:
981         * platform/network/ResourceHandle.h:
982         * platform/network/ResourceHandleInternal.h:
983         * platform/network/SocketStreamHandleClient.h:
984         * platform/network/soup/ResourceRequest.h:
985         * platform/network/soup/SocketStreamHandleImpl.h:
986         * platform/network/soup/SoupNetworkSession.h:
987         * platform/sql/SQLiteFileSystem.h:
988         * platform/text/LocaleICU.h:
989
990 2017-06-25  Youenn Fablet  <youenn@apple.com>
991
992         Remove use of mock webrtc backend factory at injected bundle reset time
993         https://bugs.webkit.org/show_bug.cgi?id=173817
994
995         Reviewed by Darin Adler.
996
997         * testing/Internals.cpp:
998         (WebCore::Internals::resetToConsistentState): Resetting the peer connection backend.
999         * testing/MockLibWebRTCPeerConnection.cpp: Doing some clean-up
1000         (WebCore::useRealRTCPeerConnectionFactory):
1001         (WebCore::MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory):
1002         (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
1003         (WebCore::MockLibWebRTCPeerConnectionFactory::CreateVideoTrack):
1004         (WebCore::MockLibWebRTCPeerConnectionFactory::CreateAudioTrack):
1005         * testing/MockLibWebRTCPeerConnection.h:
1006
1007 2017-06-25  Konstantin Tokarev  <annulen@yandex.ru>
1008
1009         Remove excessive headers from JavaScriptCore
1010         https://bugs.webkit.org/show_bug.cgi?id=173812
1011
1012         Reviewed by Darin Adler.
1013
1014         No new tests needed.
1015
1016         * Modules/indexeddb/IDBObjectStore.cpp:
1017         * bindings/js/JSDOMPromiseDeferred.h:
1018         * bindings/js/JSLazyEventListener.cpp:
1019         * bindings/js/JSMainThreadExecState.h:
1020         * bindings/js/ReadableStreamDefaultController.cpp:
1021         * bindings/js/ScriptGlobalObject.cpp:
1022         * bindings/js/SerializedScriptValue.cpp:
1023         * bridge/NP_jsobject.cpp:
1024         * dom/ScriptExecutionContext.cpp:
1025         * html/HTMLPlugInImageElement.cpp:
1026
1027 2017-06-25  Konstantin Tokarev  <annulen@yandex.ru>
1028
1029         Remove excessive headers from WebCore/{rendering,style,svg}
1030         https://bugs.webkit.org/show_bug.cgi?id=173773
1031
1032         Reviewed by Darin Adler.
1033
1034         No new tests needed.
1035
1036         * css/StyleBuilderConverter.h:
1037         * editing/TextIterator.cpp:
1038         * rendering/CounterNode.h:
1039         * rendering/FlexibleBoxAlgorithm.h:
1040         * rendering/HitTestLocation.h:
1041         * rendering/HitTestResult.h:
1042         * rendering/HitTestingTransformState.h:
1043         * rendering/OrderIterator.h:
1044         * rendering/RenderButton.h:
1045         * rendering/RenderCombineText.h:
1046         * rendering/RenderFlowThread.h:
1047         * rendering/RenderFullScreen.h:
1048         * rendering/RenderGeometryMap.h:
1049         * rendering/RenderListItem.h:
1050         * rendering/RenderMediaControlElements.cpp:
1051         * rendering/RenderMediaControlElements.h:
1052         * rendering/RenderMediaControls.h:
1053         * rendering/RenderMeter.h:
1054         * rendering/RenderMultiColumnSet.cpp:
1055         * rendering/RenderObject.h:
1056         * rendering/RenderRegion.h:
1057         * rendering/RenderRegionSet.cpp:
1058         * rendering/RenderRegionSet.h:
1059         * rendering/RenderTheme.h:
1060         * rendering/RenderVTTCue.cpp:
1061         * rendering/RenderVTTCue.h:
1062         * rendering/SimpleLineLayoutFunctions.h:
1063         * rendering/SimpleLineLayoutResolver.h:
1064         * rendering/line/BreakingContext.h:
1065         * rendering/line/LineBreaker.h:
1066         * rendering/mathml/MathMLStyle.h:
1067         * rendering/mathml/RenderMathMLOperator.h:
1068         * rendering/mathml/RenderMathMLRoot.h:
1069         * rendering/shapes/RectangleShape.h:
1070         * rendering/style/BasicShapes.h:
1071         * rendering/style/BorderData.h:
1072         * rendering/style/CounterDirectives.h:
1073         * rendering/style/GridArea.h:
1074         * rendering/style/KeyframeList.h:
1075         * rendering/style/RenderStyle.h:
1076         * rendering/style/SVGRenderStyle.h:
1077         * rendering/style/ShapeValue.h:
1078         * rendering/style/StyleCachedImage.h:
1079         * rendering/style/StyleMultiColData.h:
1080         * rendering/style/StyleRareNonInheritedData.h:
1081         * rendering/style/WillChangeData.h:
1082         * rendering/svg/RenderSVGBlock.h:
1083         * rendering/svg/RenderSVGRect.h:
1084         * rendering/svg/RenderSVGResource.h:
1085         * rendering/svg/RenderSVGResourceContainer.h:
1086         * rendering/svg/RenderSVGResourceMarker.h:
1087         * rendering/svg/RenderSVGResourceMasker.h:
1088         * rendering/svg/RenderSVGResourcePattern.h:
1089         * rendering/svg/SVGInlineFlowBox.cpp:
1090         * rendering/svg/SVGInlineTextBox.h:
1091         * rendering/svg/SVGRootInlineBox.h:
1092         * rendering/svg/SVGTextChunk.cpp:
1093         * rendering/svg/SVGTextChunk.h:
1094         * rendering/svg/SVGTextChunkBuilder.cpp:
1095         * rendering/svg/SVGTextLayoutEngine.cpp:
1096         * rendering/svg/SVGTextLayoutEngineSpacing.h:
1097         * style/RenderTreePosition.cpp:
1098         * style/RenderTreePosition.h:
1099         * style/RenderTreeUpdater.h:
1100         * style/StyleFontSizeFunctions.h:
1101         * style/StyleInvalidator.h:
1102         * style/StyleResolveForDocument.h:
1103         * style/StyleScope.h:
1104         * style/StyleTreeResolver.cpp:
1105         * style/StyleTreeResolver.h:
1106         * style/StyleUpdate.h:
1107         * svg/SVGAnimationElement.h:
1108         * svg/SVGFEBlendElement.cpp:
1109         * svg/SVGFEBlendElement.h:
1110         * svg/SVGFEComponentTransferElement.h:
1111         * svg/SVGFEFloodElement.cpp:
1112         * svg/SVGFEFloodElement.h:
1113         * svg/SVGFEImageElement.h:
1114         * svg/SVGFEMergeElement.cpp:
1115         * svg/SVGFEMergeElement.h:
1116         * svg/SVGFEOffsetElement.cpp:
1117         * svg/SVGFEOffsetElement.h:
1118         * svg/SVGFETileElement.cpp:
1119         * svg/SVGFETileElement.h:
1120         * svg/SVGParserUtilities.h:
1121         * svg/SVGPathByteStream.h:
1122         * svg/SVGPathElement.cpp:
1123         * svg/SVGPolyElement.cpp:
1124         * svg/SVGSVGElement.cpp:
1125         * svg/SVGTRefElement.cpp:
1126         * svg/SVGTextPathElement.cpp:
1127         * svg/SVGUseElement.cpp:
1128         * svg/animation/SMILTimeContainer.h:
1129         * svg/graphics/SVGImageCache.h:
1130         * svg/graphics/filters/SVGFilter.h:
1131
1132 2017-06-25  Antoine Quint  <graouts@apple.com>
1133
1134         Remove rAf suspension logging
1135         https://bugs.webkit.org/show_bug.cgi?id=173821
1136
1137         Reviewed by Tim Horton.
1138
1139         Now that webkit.org/b/173628 is fixed, we can remove the logging code we added.
1140
1141         * dom/Document.cpp:
1142         (WebCore::Document::requestAnimationFrame):
1143         * dom/ScriptedAnimationController.cpp:
1144         (WebCore::ScriptedAnimationController::suspend):
1145         (WebCore::ScriptedAnimationController::resume):
1146         * page/Page.cpp:
1147         (WebCore::Page::suspendScriptedAnimations):
1148         (WebCore::Page::resumeScriptedAnimations):
1149         (WebCore::Page::setIsVisibleInternal):
1150         * platform/RuntimeApplicationChecks.h:
1151         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
1152         (WebCore::MacApplication::isDumpRenderTree): Deleted.
1153
1154 2017-06-24  Sam Weinig  <sam@webkit.org>
1155
1156         [WebIDL] Add complete support for stringifier
1157         https://bugs.webkit.org/show_bug.cgi?id=173724
1158
1159         Reviewed by Darin Adler.
1160
1161         * bindings/scripts/CodeGeneratorJS.pm:
1162         (AddStringifierOperationIfNeeded):
1163         Update AddStringifierOperationIfNeeded to support stringifier on operations and be more
1164         strict about the allowed types. Also copies over all extended attributes to the synthetic
1165         operation.
1166
1167         * bindings/scripts/IDLParser.pm:
1168         (parseInterfaceMember):
1169         (parseOperationOrReadWriteAttributeOrMaplike):
1170         (parseReadOnlyMember):
1171         (parseStringifier):
1172         (parseStaticMember):
1173         (parseAttributeOrOperationForStringifierOrStatic):
1174         (parseReadWriteAttribute):
1175         (parseAttributeRest):
1176         (parseOperation):
1177         (parseSpecialOperation):
1178         (parseMapLikeProperties):
1179         (parseOperationRest):
1180         (parseAttributeOrOperationOrIterator): Deleted.
1181         (parseQualifier): Deleted.
1182         (parseAttributeOrOperationRest): Deleted.
1183         (parseAttribute): Deleted.
1184         (parseOperationOrIterator): Deleted.
1185         - Update parser to more closely resemble the WebIDL grammar, splitting out parseStringifier and
1186           parseStaticMember into their own subroutines. 
1187         - Move those and parseSerializer, parseStringifier, parseStaticMember, parseIterableRest and a split out
1188           parseReadOnlyMembers up into parseInterfaceMember to make it clearer that they are top level members
1189           and match the grammar.
1190         - Rename parseAttributeOrOperationOrIterator to parseOperationOrReadWriteAttributeOrMaplike to match the
1191           grammar language and make it clear what it does.
1192         - Add parseAttributeOrOperationForStringifierOrStatic which contains most of the logic for parsing stringifiers
1193           and static members, which have almost identical grammars.
1194         - Remove creator special which no longer exists in the spec.
1195
1196         * css/DOMMatrixReadOnly.idl:
1197         * css/WebKitCSSMatrix.idl:
1198         * dom/Range.idl:
1199         * html/URLSearchParams.idl:
1200         Fix FIXMEs by switching to use stringifier.
1201
1202         * bindings/scripts/test/JS/JSTestStringifier.cpp: Added.
1203         * bindings/scripts/test/JS/JSTestStringifier.h: Added.
1204         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp: Added.
1205         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.h: Added.
1206         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp: Added.
1207         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.h: Added.
1208         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp: Added.
1209         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.h: Added.
1210         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp: Added.
1211         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.h: Added.
1212         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp: Added.
1213         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.h: Added.
1214         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: Added.
1215         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.h: Added.
1216         * bindings/scripts/test/TestStringifier.idl: Added.
1217         * bindings/scripts/test/TestStringifierAnonymousOperation.idl: Added.
1218         * bindings/scripts/test/TestStringifierNamedOperation.idl: Added.
1219         * bindings/scripts/test/TestStringifierOperationImplementedAs.idl: Added.
1220         * bindings/scripts/test/TestStringifierOperationNamedToString.idl: Added.
1221         * bindings/scripts/test/TestStringifierReadOnlyAttribute.idl: Added.
1222         * bindings/scripts/test/TestStringifierReadWriteAttribute.idl: Added.
1223         Add new tests.
1224
1225 2017-06-24  Chris Fleizach  <cfleizach@apple.com>
1226
1227         AX: Cannot call setValue() on contenteditable or ARIA text controls
1228         https://bugs.webkit.org/show_bug.cgi?id=173520
1229
1230         Reviewed by Ryosuke Niwa.
1231
1232         Add support for changing the value of a contenteditable and any other aria text control in setValue().
1233  
1234         Test: accessibility/mac/set-value-editable-types.html
1235
1236         * accessibility/AccessibilityRenderObject.cpp:
1237         (WebCore::AccessibilityRenderObject::setValue):
1238
1239 2017-06-23  Simon Fraser  <simon.fraser@apple.com>
1240
1241         Attempt to fix an internal build after r218755.
1242
1243         * bindings/js/JSMainThreadExecStateInstrumentation.h:
1244
1245 2017-06-23  Chris Dumez  <cdumez@apple.com>
1246
1247         Add release assertion to make sure callbackIdentifier is not 0 in DocumentLoader::finishedLoadingIcon()
1248         https://bugs.webkit.org/show_bug.cgi?id=173792
1249
1250         Reviewed by Ryosuke Niwa.
1251
1252         Add release assertion to make sure callbackIdentifier is not 0 in DocumentLoader::finishedLoadingIcon()
1253         as this could cause HashTable corruption on WebPageProxy side.
1254
1255         * loader/DocumentLoader.cpp:
1256         (WebCore::DocumentLoader::finishedLoadingIcon):
1257
1258 2017-06-23  Youenn Fablet  <youenn@apple.com>
1259
1260         webrtc::WebRtcSession is not handling correctly its state when setLocalDescription fails and is called again
1261         https://bugs.webkit.org/show_bug.cgi?id=173783
1262
1263         Reviewed by Alex Christensen.
1264
1265         Test: webrtc/libwebrtc/setLocalDescriptionCrash.html
1266
1267         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1268         (WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription): Fail early if there is no pending remote description and description is for an answer.
1269
1270 2017-06-23  Eric Carlson  <eric.carlson@apple.com>
1271
1272         [MediaStream macOS] enumerateDevices should only return valid audio capture devices
1273         https://bugs.webkit.org/show_bug.cgi?id=173790
1274         <rdar://problem/32260334>
1275
1276         Reviewed by Youenn Fablet.
1277
1278         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
1279         (WebCore::isValidCaptureDevice): A valid device has a name and is not an aggregate device
1280         created by VPIO.
1281         (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
1282
1283 2017-06-23  Jer Noble  <jer.noble@apple.com>
1284
1285         [WK2] Support -[WebAVPlayerController setMuted:]
1286         https://bugs.webkit.org/show_bug.cgi?id=173777
1287
1288         Reviewed by Eric Carlson.
1289
1290         Have -[WebAVPlayerController setMuted:] pass the request to its delegate (the model)
1291         rather than just storing the value.
1292
1293         * platform/cocoa/WebPlaybackSessionModel.h:
1294         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
1295         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
1296         (WebCore::WebPlaybackSessionModelMediaElement::toggleMuted):
1297         (WebCore::WebPlaybackSessionModelMediaElement::setMuted):
1298         * platform/ios/WebAVPlayerController.h:
1299         * platform/ios/WebAVPlayerController.mm:
1300         (-[WebAVPlayerController isMuted]):
1301         (-[WebAVPlayerController setMuted:]):
1302         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1303         (WebVideoFullscreenControllerContext::setMuted):
1304
1305 2017-06-23  Frederic Wang  <fwang@igalia.com>
1306
1307         Make RenderLayer::handleTouchEvent use usesAcceleratedScrolling()
1308         https://bugs.webkit.org/show_bug.cgi?id=173763
1309
1310         Reviewed by Simon Fraser.
1311
1312         No new tests, behavior is unchanged.
1313
1314         * rendering/RenderLayer.cpp:
1315         (WebCore::RenderLayer::handleTouchEvent): Call usesAcceleratedScrolling() instead of
1316         hasTouchScrollableOverflow() for clarity.
1317
1318 2017-06-23  Konstantin Tokarev  <annulen@yandex.ru>
1319
1320         Remove excessive headers from WebCore/{bindings,css,dom}
1321         https://bugs.webkit.org/show_bug.cgi?id=173766
1322
1323         Reviewed by Simon Fraser.
1324
1325         No new tests needed.
1326
1327         * ForwardingHeaders/runtime/ThrowScope.h: Added.
1328         * Modules/plugins/QuickTimePluginReplacement.mm:
1329         * bindings/js/CachedScriptSourceProvider.h:
1330         * bindings/js/JSCommandLineAPIHostCustom.cpp:
1331         * bindings/js/JSCustomXPathNSResolver.cpp:
1332         * bindings/js/JSDOMConstructorNotConstructable.h:
1333         * bindings/js/JSDOMConvertBase.h:
1334         * bindings/js/JSDOMConvertBufferSource.h:
1335         * bindings/js/JSDOMConvertInterface.h:
1336         * bindings/js/JSDOMConvertStrings.h:
1337         * bindings/js/JSDOMConvertUnion.h:
1338         * bindings/js/JSDOMConvertVariadic.h:
1339         * bindings/js/JSDOMConvertWebGL.h:
1340         * bindings/js/JSDOMExceptionHandling.h:
1341         * bindings/js/JSDOMIterator.h:
1342         * bindings/js/JSDOMMapLike.h:
1343         * bindings/js/JSDOMWindowBase.cpp:
1344         * bindings/js/JSDOMWindowCustom.cpp:
1345         * bindings/js/JSDOMWindowCustom.h:
1346         * bindings/js/JSDOMWindowProperties.h:
1347         * bindings/js/JSDOMWrapperCache.h:
1348         * bindings/js/JSLazyEventListener.cpp:
1349         * bindings/js/JSMainThreadExecStateInstrumentation.h:
1350         * bindings/js/JSMediaListCustom.h:
1351         * bindings/js/JSNodeCustom.h:
1352         * bindings/js/JSNodeListCustom.h:
1353         * bindings/js/JSVideoTrackListCustom.cpp:
1354         * bindings/js/ScheduledAction.h:
1355         * bindings/js/ScriptSourceCode.h:
1356         * bindings/js/SerializedScriptValue.h:
1357         * bindings/js/WebCoreJSClientData.h:
1358         * css/CSSFontFeatureValue.h:
1359         * css/CSSPrimitiveValue.h:
1360         * css/CSSStyleSheet.h:
1361         * css/CSSValue.h:
1362         * css/StyleBuilderCustom.h:
1363         * dom/ContainerNodeAlgorithms.h:
1364         * dom/DataTransfer.h:
1365         * dom/Node.h:
1366         * dom/NodeRareData.h:
1367         * dom/Position.h:
1368         * dom/RenderedDocumentMarker.h:
1369
1370 2017-06-23  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1371
1372         Fix broken WinCairo build
1373
1374         [Curl] Extract CurlDownloadManager as shared background task handler
1375         https://bugs.webkit.org/show_bug.cgi?id=173557
1376
1377         Reviewed by Joseph Pecoraro.
1378
1379         * platform/network/curl/CurlManager.h:
1380
1381 2017-06-23  Chris Dumez  <cdumez@apple.com>
1382
1383         [iOS] Potential crash under WebCore::notifyLowPowerModeChanged(WebCore::LowPowerModeNotifier*, bool)
1384         https://bugs.webkit.org/show_bug.cgi?id=173755
1385         <rdar://problem/32940942>
1386
1387         Reviewed by Mark Lam.
1388
1389         The crash was happening because the WebLowPowerModeObserver would dispatch
1390         a lambda to the main thread but the LowPowerModeNotifier object could be
1391         dead by the time we get to the main thread.
1392
1393         To address the issue, keep a strong ref to the WebLowPowerModeObserver in
1394         the lambda we dispatch to the main thread to make sure it stays alive until
1395         we execute the lambda. In the LowPowerModeNotifier destructor, we now reset
1396         the WebLowPowerModeObserver's notifier pointer to nil and I added a null
1397         check for this notifier in the lambda.
1398
1399         * platform/LowPowerModeNotifier.cpp:
1400         (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier):
1401         * platform/LowPowerModeNotifier.h:
1402         * platform/ios/LowPowerModeNotifierIOS.mm:
1403         (-[WebLowPowerModeObserver initWithNotifier:]):
1404         (-[WebLowPowerModeObserver _didReceiveLowPowerModeChange]):
1405         (WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
1406         (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier):
1407         (WebCore::notifyLowPowerModeChanged):
1408
1409 2017-06-23  Alex Christensen  <achristensen@webkit.org>
1410
1411         Add SPI to WKURLSchemeTask for redirection
1412         https://bugs.webkit.org/show_bug.cgi?id=173730
1413
1414         Reviewed by Brady Eidson.
1415
1416         * platform/network/CacheValidation.cpp:
1417         (WebCore::computeFreshnessLifetimeForHTTPFamily):
1418         Asserting that redirects are always http/https URLs is no longer valid.
1419         If there's a custom scheme redirect, give it no freshness lifetime in the cache.
1420
1421 2017-06-23  Konstantin Tokarev  <annulen@yandex.ru>
1422
1423         Remove excessive headers from WebCore/{editing,fileapi,history,html,loader,page}
1424         https://bugs.webkit.org/show_bug.cgi?id=173769
1425
1426         Reviewed by Simon Fraser.
1427
1428         No new tests needed.
1429
1430         * css/CSSFontFaceSource.cpp:
1431         * editing/DictationCommand.cpp:
1432         * editing/Editor.h:
1433         * editing/VisiblePosition.h:
1434         * editing/VisibleUnits.h:
1435         * fileapi/BlobBuilder.h:
1436         * history/PageCache.h:
1437         * html/DOMURL.h:
1438         * html/HTMLCollection.h:
1439         * html/HTMLMediaElement.cpp:
1440         * html/HTMLMediaElement.h:
1441         * html/HTMLPlugInImageElement.cpp:
1442         * html/StepRange.h:
1443         * html/canvas/CanvasRenderingContext.h:
1444         * html/canvas/CanvasRenderingContext2D.h:
1445         * html/parser/HTMLDocumentParser.cpp:
1446         * html/parser/HTMLElementStack.h:
1447         * html/parser/HTMLInputStream.h:
1448         * html/shadow/MediaControlElements.cpp:
1449         * html/shadow/MediaControls.cpp:
1450         * html/shadow/MediaControls.h:
1451         * html/track/TrackListBase.h:
1452         * html/track/VTTCue.h:
1453         * html/track/WebVTTParser.cpp:
1454         * html/track/WebVTTParser.h:
1455         * loader/CrossOriginPreflightChecker.cpp:
1456         * loader/DocumentThreadableLoader.cpp:
1457         * loader/FrameLoaderClient.h:
1458         * loader/LinkPreloadResourceClients.h:
1459         * loader/LoadTiming.h:
1460         * loader/ThreadableLoaderClientWrapper.h:
1461         * loader/WorkerThreadableLoader.h:
1462         * loader/cache/CachedResourceLoader.h:
1463         * loader/cache/CachedResourceRequest.h:
1464         * loader/cache/CachedSVGDocument.h:
1465         * loader/cache/CachedTextTrack.h:
1466         * loader/icon/IconLoader.cpp:
1467         * page/AlternativeTextClient.h:
1468         * page/CaptionUserPreferences.cpp:
1469         * page/CaptionUserPreferences.h:
1470         * page/ContextMenuClient.h:
1471         * page/MainFrame.h:
1472         * page/Page.h:
1473         * page/PageGroup.h:
1474         * page/PerformanceEntry.h:
1475         * page/PerformanceResourceTiming.h:
1476         * page/ResourceUsageOverlay.cpp:
1477         * page/ResourceUsageOverlay.h:
1478         * page/UserContentController.h:
1479         * page/UserContentProvider.h:
1480         * page/animation/AnimationBase.h:
1481         * page/animation/CSSPropertyAnimation.h:
1482         * page/animation/CompositeAnimation.h:
1483         * page/scrolling/ScrollingCoordinator.h:
1484         * xml/XSLTProcessorLibxslt.cpp:
1485         * xml/parser/XMLDocumentParserLibxml2.cpp:
1486
1487 2017-06-23  Chris Dumez  <cdumez@apple.com>
1488
1489         [mac-wk1] requestAnimationFrame callbacks may not get serviced
1490         https://bugs.webkit.org/show_bug.cgi?id=173628
1491
1492         Reviewed by Simon Fraser.
1493
1494         Page::setIsVisibleInternal() was firing the 'visibilitychange' event
1495         synchronously while in the middle of updating its visibility/activity
1496         state. This allowed the JavaScript to re-enter the method by calling
1497         testRunner.setPageVisibility() / resetPageVisiblity() and we would
1498         end up in an inconsistent state.
1499
1500         No new tests, extended existing test.
1501
1502         * dom/Document.cpp:
1503         (WebCore::Document::visibilityStateChanged):
1504         Do no fire the visibilitychange event synchronously as we are in the
1505         middle of updating the page's activity state. Instead fire the
1506         event asynchronously.
1507
1508         * page/Page.cpp:
1509         (WebCore::Page::setIsVisibleInternal):
1510         Move the calling of Document::visibilityStateChanged() until after we're
1511         done updating the page's visibility state.
1512
1513         * testing/Internals.cpp:
1514         (WebCore::Internals::scriptedAnimationsAreSuspended):
1515         * testing/Internals.h:
1516         * testing/Internals.idl:
1517         Add test infrastructure to check if scripted animations are suspended.
1518
1519 2017-06-23  Eric Carlson  <eric.carlson@apple.com>
1520
1521         [iOS] Respond to AudioSession interruption and resume
1522         https://bugs.webkit.org/show_bug.cgi?id=173718
1523         <rdar://problem/32925263>
1524
1525         Reviewed by Youenn Fablet.
1526
1527         Tested manually.
1528
1529         * WebCore.xcodeproj/project.pbxproj: Add CoreAudioCaptureSourceIOS.mm/.h
1530
1531         * platform/mediastream/RealtimeMediaSource.h: Make createWeakPtr protected so derived classes
1532         can use it.
1533
1534         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.h: Added.
1535         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm: Added.
1536         (-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]):
1537         (-[WebCoreAudioCaptureSourceIOSListener invalidate]):
1538         (-[WebCoreAudioCaptureSourceIOSListener handleInterruption:]):
1539         (-[WebCoreAudioCaptureSourceIOSListener sessionMediaServicesWereReset:]):
1540         (WebCore::CoreAudioCaptureSourceIOS::CoreAudioCaptureSourceIOS):
1541         (WebCore::CoreAudioCaptureSourceIOS::~CoreAudioCaptureSourceIOS):
1542
1543         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1544         (WebCore::CoreAudioSharedUnit::suspended): 
1545         (WebCore::CoreAudioSharedUnit::setupAudioUnit): Clear m_suspended.
1546         (WebCore::CoreAudioSharedUnit::suspend): Don't clear sources or uninitialize the audio unit,
1547         suspend is temporary. Set m_suspended.
1548         (WebCore::CoreAudioSharedUnit::resume): New, restart the audio unit.
1549         (WebCore::CoreAudioCaptureSource::create): Create the correct object.
1550         (WebCore::CoreAudioCaptureSource::scheduleReconfiguration): Dispatch to main thread if necessary.
1551         (WebCore::CoreAudioCaptureSource::beginInterruption): New, suspend from main thread.
1552         (WebCore::CoreAudioCaptureSource::endInterruption): New, resume/reconfigure from main thread.
1553         (WebCore::CoreAudioCaptureSource::interrupted):
1554         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1555
1556 2017-06-23  Zan Dobersek  <zdobersek@igalia.com>
1557
1558         [GCrypt] Drop the AES-CFB support
1559         https://bugs.webkit.org/show_bug.cgi?id=173547
1560
1561         Reviewed by Jiewen Tan.
1562
1563         No new tests -- relevant test baselines are updated.
1564
1565         Stop registering the AES-CFB algorithm as something that's supported by
1566         the libgcrypt implementation. This algorithm was previously included in
1567         the Web Crypto API specification, but has since been dropped from it.
1568
1569         Conveniently, libgcrypt only recently gained support for the CFB8 AES
1570         cipher mode that's required by the specification, meaning we could only
1571         support this algorithm with future releases of the libgcrypt library.
1572
1573         * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
1574         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
1575
1576 2017-06-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1577
1578         [WPE] Enable PUBLIC_SUFFIX_LIST
1579         https://bugs.webkit.org/show_bug.cgi?id=173758
1580
1581         Reviewed by Žan Doberšek.
1582
1583         * PlatformWPE.cmake: Add PublicSuffixSoup.cpp to the build.
1584
1585 2017-06-22  Antti Koivisto  <antti@apple.com>
1586
1587         REGRESSION(r217695): Offscreen/overflowed items not being rendered while translating in-frame
1588         https://bugs.webkit.org/show_bug.cgi?id=173732
1589
1590         Reviewed by Simon Fraser.
1591
1592         If an accelerated animation starts completely outside the view we fail to create backing for it
1593         when it moves into view.
1594
1595         Fix by computing the full extent rect of the animation when it starts and doing the viewport overlap
1596         testing with that.
1597
1598         Test: compositing/backing/transform-transition-from-outside-view.html
1599
1600         * platform/graphics/GraphicsLayer.h:
1601         (WebCore::GraphicsLayer::animationExtent):
1602         (WebCore::GraphicsLayer::setAnimationExtent):
1603         * platform/graphics/ca/GraphicsLayerCA.cpp:
1604         (WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect):
1605
1606             Return the current animation transformation matrix so we can use it elsewhere without recomputing.
1607
1608         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
1609
1610             If we have animation extent use it instead of bounds for visibility testing.
1611
1612         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
1613
1614             Track if theres is a visible ancestor layer with a transition animation.
1615
1616         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
1617         (WebCore::GraphicsLayerCA::updateCoverage):
1618
1619             For simplicity create backing for all sublayers of a visible transform animated layer.
1620
1621         * platform/graphics/ca/GraphicsLayerCA.h:
1622         (WebCore::GraphicsLayerCA::VisibleAndCoverageRects::VisibleAndCoverageRects): Deleted.
1623         * rendering/RenderLayerBacking.cpp:
1624         (WebCore::RenderLayerBacking::updateGeometry):
1625
1626             Pass the animation extent (including descendants) to GraphicsLayer.
1627
1628 2017-06-22  Chris Dumez  <cdumez@apple.com>
1629
1630         ResourceLoadStatisticsStore should be ThreadSafeRefCounted
1631         https://bugs.webkit.org/show_bug.cgi?id=173753
1632         <rdar://problem/32939326>
1633
1634         Reviewed by Andreas Kling.
1635
1636         ResourceLoadStatisticsStore should be ThreadSafeRefCounted as it is ref'd/deref'd
1637         from different threads.
1638
1639         * loader/ResourceLoadStatisticsStore.h:
1640
1641 2017-06-22  Myles C. Maxfield  <mmaxfield@apple.com>
1642
1643         @font-face rules with invalid primary fonts never download their secondary fonts
1644         https://bugs.webkit.org/show_bug.cgi?id=173138
1645         <rdar://problem/32554450>
1646
1647         Reviewed by Simon Fraser.
1648
1649         We have logic in CSSFontAccessor::font() which disallows downloading a CSSFontFace if that CSSFontFace
1650         is already in the Succeeded state. However, it was possible for a succeeded CSSFontFace to still fail
1651         to create a font. In this situation, we wouldn't be able to use the downloaded font, and we wouldn't
1652         try to download the next item in the src: list because the CSSFontFace is succeeded.
1653
1654         This patch strengthens the meaning of the Succeeded state. Previously, it just meant that the bytes
1655         in the file were downloaded successfully. This patch extends this to also mean that the bytes in the
1656         file can be successfully interpreted as a font. This way, the CSSFontFace in the example above won't be
1657         set to the Succeeded state, so we will continue follow the src: list and download the secondary fonts.
1658
1659         This has an added benefit that the CSS Font Loading API's promises will be called more appropriately.
1660         The transition to the Succeeded state will trigger a resolve of the promise. Now, these promises will
1661         only be resolved if the fonts are actually parsed and understood by our text system.
1662
1663         Test: fast/text/font-fallback-invalid-load.html
1664
1665         * css/CSSFontFaceSource.cpp:
1666         (WebCore::CSSFontFaceSource::fontLoaded): Move to the failed state if we can't understand the font
1667         data. This is the crux of this patch.
1668         (WebCore::CSSFontFaceSource::font): This function should only be called if we are in the Succeeded
1669         state, which means now we know we should always be able to understand the bytes of the file. Therefore,
1670         we can change some if statements into ASSERT()s.
1671         * loader/cache/CachedSVGFont.cpp:
1672         (WebCore::CachedSVGFont::createFont): Ditto.
1673         (WebCore::CachedSVGFont::ensureCustomFontData): Similarly to CSSFontFaceSource::fontLoaded(), this
1674         adds another check to our criteria for transitioning into the Succeeded state, which will guarantee that
1675         later we will always be able to create the font object.
1676
1677 2017-06-22  Andreas Kling  <akling@apple.com>
1678
1679         Rename MemoryPressureHandler::setTabCount to setPageCount
1680         https://bugs.webkit.org/show_bug.cgi?id=173750
1681
1682         Reviewed by Daniel Bates.
1683
1684         * page/Page.cpp:
1685         (WebCore::Page::~Page):
1686
1687 2017-06-22  Antoine Quint  <graouts@apple.com>
1688
1689         Modern media controls localised strings are out of sync with used strings in code
1690         https://bugs.webkit.org/show_bug.cgi?id=173752
1691
1692         Reviewed by Dean Jackson.
1693
1694         Remove strings we no longer use and add strings we use but failed to add previously.
1695
1696         * English.lproj/modern-media-controls-localized-strings.js:
1697
1698 2017-06-22  Antoine Quint  <graouts@apple.com>
1699
1700         Log when scripted animations get suspended and resumed
1701         https://bugs.webkit.org/show_bug.cgi?id=173751
1702
1703         Reviewed by Dean Jackson.
1704
1705         More work toward understanding why rAF callbacks are not serviced on bots (webkit.org/b/173628).
1706
1707         * dom/Document.cpp:
1708         (WebCore::Document::requestAnimationFrame):
1709         * dom/ScriptedAnimationController.cpp:
1710         (WebCore::ScriptedAnimationController::suspend):
1711         (WebCore::ScriptedAnimationController::resume):
1712         (WebCore::ScriptedAnimationController::logSuspendCount): Deleted.
1713         * dom/ScriptedAnimationController.h:
1714         * page/Page.cpp:
1715         (WebCore::Page::suspendScriptedAnimations):
1716         (WebCore::Page::resumeScriptedAnimations):
1717         (WebCore::Page::setIsVisibleInternal):
1718
1719 2017-06-22  Zalan Bujtas  <zalan@apple.com>
1720
1721         REGRESSION(r214712): Infinite recursion in RenderTable::layout in paginated mode
1722         https://bugs.webkit.org/show_bug.cgi?id=173731
1723         <rdar://problem/32237775>
1724
1725         Reviewed by Antti Koivisto.
1726
1727         We should just skip bottom captions to check if section is moved, since they don't affect
1728         the section position (bottom <caption> is preceded by <tfoot>).
1729
1730         Test: fast/table/caption-bottom-with-pagination.html
1731
1732         * rendering/RenderTable.cpp:
1733         (WebCore::RenderTable::layout):
1734
1735 2017-06-22  Dean Jackson  <dino@apple.com>
1736
1737         REGRESSION (r215809): 50% regression 14E305 -> 15A293a in MotionMark Suits test
1738         https://bugs.webkit.org/show_bug.cgi?id=173728
1739         <rdar://problem/32526744>
1740
1741         Reviewed by Tim Horton.
1742
1743         It turns out that CGGradientCreateWithColors is much slower than
1744         CGGradientCreateWithColorComponents, even without colorspace variations.
1745         Update the gradient creation code to only use this slower path
1746         when it has extended colors.
1747
1748         * platform/graphics/Color.h: Add a FIXME about renaming some methods.
1749         * platform/graphics/cg/GradientCG.cpp: Use CGGradientCreateWithColorComponents
1750         if we have stops that are not extended colors.
1751         (WebCore::Gradient::platformGradient):
1752
1753 2017-06-22  Youenn Fablet  <youenn@apple.com>
1754
1755         Fix memory leak in LibWebRTCMediaEndpoint
1756         https://bugs.webkit.org/show_bug.cgi?id=173717
1757
1758         Reviewed by Eric Carlson.
1759
1760         No chnage of behavior.
1761         Making sure SessionDescription pointer get properly released.
1762
1763         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1764         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded):
1765         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1766         * testing/MockLibWebRTCPeerConnection.cpp: Allocating description.
1767
1768 2017-06-22  Daniel Bates  <dabates@apple.com>
1769
1770         Make FrameLoadRequest a move-only type
1771         https://bugs.webkit.org/show_bug.cgi?id=173682
1772
1773         Reviewed by Alex Christensen and Darin Adler.
1774
1775         A FrameLoadRequest groups together the information to perform a load into a single object
1776         that is more manageable to pass around than its constituent parts. Code that receives a
1777         FrameLoadRequest is expected to extract out the information it needs to complete its task.
1778         And it does not make sense to re-use the same FrameLoadRequest object for more than one
1779         load. Therefore, it is sufficient to make FrameLoadRequest a move-only type.
1780
1781         * inspector/InspectorFrontendClientLocal.cpp:
1782         (WebCore::InspectorFrontendClientLocal::openInNewTab):
1783         * inspector/InspectorPageAgent.cpp:
1784         (WebCore::InspectorPageAgent::navigate):
1785         * loader/FrameLoadRequest.h:
1786         * loader/FrameLoader.cpp:
1787         (WebCore::FrameLoader::changeLocation):
1788         (WebCore::FrameLoader::urlSelected):
1789         (WebCore::FrameLoader::loadURLIntoChildFrame):
1790         (WebCore::FrameLoader::loadFrameRequest):
1791         (WebCore::FrameLoader::loadURL):
1792         (WebCore::FrameLoader::load):
1793         (WebCore::FrameLoader::loadPostRequest):
1794         (WebCore::createWindow):
1795         * loader/FrameLoader.h:
1796         * loader/NavigationScheduler.cpp:
1797         (WebCore::NavigationScheduler::scheduleLocationChange):
1798         * page/ContextMenuController.cpp:
1799         (WebCore::openNewWindow):
1800         (WebCore::ContextMenuController::contextMenuItemSelected):
1801         * page/DOMWindow.cpp:
1802         (WebCore::DOMWindow::createWindow):
1803         * replay/UserInputBridge.cpp:
1804         (WebCore::UserInputBridge::loadRequest):
1805         * replay/UserInputBridge.h:
1806
1807 2017-06-22  Jer Noble  <jer.noble@apple.com>
1808
1809         REGRESSION (r217223): [iOS] Video keeps playing after application is backgrounded
1810         https://bugs.webkit.org/show_bug.cgi?id=173727
1811
1812         Reviewed by Eric Carlson.
1813
1814         Only override media element visibility if it is in picture-in-picture mode (not fullscreen generally).
1815
1816         * html/HTMLMediaElement.cpp:
1817         (WebCore::HTMLMediaElement::visibilityStateChanged):
1818
1819 2017-06-22  Joseph Pecoraro  <pecoraro@apple.com>
1820
1821         Follow-up to r218662. Only log backtraces for DumpRenderTree.
1822
1823         Rubber-stamped by Antoine Quint.
1824
1825         * dom/ScriptedAnimationController.cpp:
1826         (WebCore::ScriptedAnimationController::logSuspendCount):
1827
1828 2017-06-22  Charlie Turner  <cturner@igalia.com>
1829
1830         [GTK] Spreaker live shows won't play
1831         https://bugs.webkit.org/show_bug.cgi?id=173306
1832
1833         Reviewed by Xabier Rodriguez-Calvar.
1834
1835         This was due to removing the code that negotiated caps for Icecast
1836         streams based on the response headers in r191947. The problem is that
1837         the typefind element can sometimes squint hard enough and see an MP3
1838         stream and attempt to play it, resulting in garbled audio playback. More
1839         commonly typefind fails to recognize the Icecast stream and bails,
1840         resulting in no playback at all.
1841
1842         r191947 also removed the emission of metadata into the pipeline. This
1843         patch also leaves that out since we have no use for it within WebKit.
1844
1845         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1846         (StreamingClient::handleResponseReceived):
1847
1848 2017-06-22  Matt Lewis  <jlewis3@apple.com>
1849
1850         Unreviewed, rolling out r218633.
1851
1852         The test is failing frequently on Sierra Debug and Windows
1853
1854         Reverted changeset:
1855
1856         "AX: Cannot call setValue() on contenteditable or ARIA text
1857         controls"
1858         https://bugs.webkit.org/show_bug.cgi?id=173520
1859         http://trac.webkit.org/changeset/218633
1860
1861 2017-06-22  Romain Bellessort  <romain.bellessort@crf.canon.fr>
1862
1863         [Readable Streams API] Implement ReadableStreamBYOBReader read()
1864         https://bugs.webkit.org/show_bug.cgi?id=172714
1865
1866         Reviewed by Youenn Fablet.
1867
1868         Implemented read() method of ReadableStreamBYOBReader [1]. Also added code related 
1869         to BYOB features that were previously described as FIXMEs and that now become reachable.
1870
1871         In addition, WPT tests that involve read() have allowed to identify 2 bugs not directly 
1872         related to read() (172716 and 172717). They will be fixed distinctly. Once done, all WPT
1873         tests should pass.
1874
1875         [1] https://streams.spec.whatwg.org/#byob-reader-read
1876
1877         WPT tests (web-platform-tests/streams/readable-byte-streams/general.js) already cover
1878         most cases for read() usage. Corresponding expectations have been updated. In addition,
1879         1 test has been added to WebKit tests (in streams/readable-stream-byob-reader.js) to 
1880         check that read() can only be applied to a ReadableStreamBYOBReader.
1881
1882         * Modules/streams/ReadableByteStreamInternals.js:
1883         (readableByteStreamControllerClearPendingPullIntos): Implemented.
1884         (readableByteStreamControllerEnqueue): Updated with support for BYOBReader.
1885         (readableByteStreamControllerPullInto): Added.
1886         (readableStreamAddReadIntoRequest): Added.
1887         * Modules/streams/ReadableStreamBYOBReader.js:
1888         (read): Added.
1889
1890 2017-06-22  Youenn Fablet  <youenn@apple.com>
1891
1892         [WebRTC] Prevent capturing at unconventional resolutions when using the SW encoder on Mac
1893         https://bugs.webkit.org/show_bug.cgi?id=172602
1894         <rdar://problem/32407693>
1895
1896         Reviewed by Eric Carlson.
1897
1898         Test: platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html
1899
1900         Add internal API to switch on/off hardware H264 encoder.
1901         Add checks for standard size. If using a software encoder and frame size is not standard,
1902         the session is destroyed and no frame is sent at all.
1903
1904         Added tests based on captureStream.
1905         Fixed the case of capturing a canvas which size is changing.
1906
1907         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
1908         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
1909         * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.h:
1910         * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.mm:
1911         (WebCore::H264VideoToolboxEncoder::setHardwareEncoderForWebRTCAllowed):
1912         (WebCore::H264VideoToolboxEncoder::hardwareEncoderForWebRTCAllowed):
1913         (WebCore::isUsingSoftwareEncoder):
1914         (WebCore::H264VideoToolboxEncoder::CreateCompressionSession):
1915         (isStandardFrameSize): Added.
1916         (isUsingSoftwareEncoder): Added.
1917         * testing/Internals.cpp:
1918         (WebCore::Internals::setH264HardwareEncoderAllowed):
1919         * testing/Internals.h:
1920         * testing/Internals.idl:
1921
1922 2017-06-21  Youenn Fablet  <youenn@apple.com>
1923
1924         [Fetch API] TypeError when called with body === {}
1925         https://bugs.webkit.org/show_bug.cgi?id=173295
1926         <rdar://problem/32746733>
1927
1928         Reviewed by Sam Weinig.
1929
1930         Test: fetch/body-init.html
1931
1932         Handling body of Request and Response using binding generator to correctly handle unions.
1933         The biggest change is that any value that is not a specific type in the union will match a String.
1934         This is matching WebIDL spec and Firefox behavior.
1935
1936         Handling of ReadableStream bodies remains in JS builtin for Response.
1937         This allows easier handling cloning and consumption of body.
1938         Adding setBodyAsReadableStream since this is no longer handled by extractBody.
1939
1940         * Modules/fetch/FetchBody.cpp:
1941         (WebCore::FetchBody::extract): Using Variant instead of JSC::JSValue.
1942         (WebCore::FetchBody::readableStreamBody): Introduced to handle the
1943         case of readable stream bodies.
1944         * Modules/fetch/FetchBody.h:
1945         * Modules/fetch/FetchBodyOwner.cpp:
1946         (WebCore::FetchBodyOwner::extractBody):
1947         * Modules/fetch/FetchBodyOwner.h:
1948         (WebCore::FetchBodyOwner::setBody):
1949         * Modules/fetch/FetchRequest.cpp:
1950         (WebCore::FetchRequest::setBody): Splitting setBody for ease of readability.
1951         (WebCore::FetchRequest::setBodyFromInputRequest):
1952         * Modules/fetch/FetchRequest.h:
1953         * Modules/fetch/FetchRequest.idl:
1954         * Modules/fetch/FetchRequest.js:
1955         (initializeFetchRequest):
1956         * Modules/fetch/FetchResponse.cpp:
1957         (WebCore::FetchResponse::initializeWith):
1958         (WebCore::FetchResponse::setBodyAsReadableStream):
1959         * Modules/fetch/FetchResponse.h:
1960         * Modules/fetch/FetchResponse.idl:
1961         * Modules/fetch/FetchResponse.js:
1962         (initializeFetchResponse):
1963         * WebCore.xcodeproj/project.pbxproj:
1964         * bindings/js/WebCoreBuiltinNames.h:
1965
1966 2017-06-21  Simon Fraser  <simon.fraser@apple.com>
1967
1968         Add z-index to compositing logging output
1969         https://bugs.webkit.org/show_bug.cgi?id=173684
1970
1971         Reviewed by Zalan Bujtas.
1972
1973         Show z-index, which is often useful to find negative z-index items.
1974
1975         Log "+foreground" rather than "foreground" to indicate that this layer has an
1976         additional foreground/background layer, and fix spacing.
1977
1978         * rendering/RenderLayerCompositor.cpp:
1979         (WebCore::RenderLayerCompositor::logLayerInfo):
1980
1981 2017-06-21  Chris Dumez  <cdumez@apple.com>
1982
1983         Unreviewed, fix Window Debug build after r218660.
1984
1985         * rendering/SimpleLineLayout.cpp:
1986         (WebCore::SimpleLineLayout::canUseForWithReason):
1987
1988 2017-06-21  Andreas Kling  <akling@apple.com>
1989
1990         Increase memory kill limits for WebContent processes that manage multiple tabs.
1991         https://bugs.webkit.org/show_bug.cgi?id=173674
1992
1993         Reviewed by Geoffrey Garen.
1994
1995         Plumb the non-utility Page count down to WTF::MemoryPressureHandler.
1996
1997         * page/Page.cpp:
1998         (WebCore::Page::Page):
1999         (WebCore::Page::~Page):
2000
2001 2017-06-21  Jiewen Tan  <jiewen_tan@apple.com>
2002
2003         [WebCrypto] Restore ordering of CryptoAlgorithmIdentifier in SerializedScriptValue
2004         https://bugs.webkit.org/show_bug.cgi?id=173678
2005         <rdar://problem/32879314>
2006
2007         Reviewed by Sam Weinig.
2008
2009         r218030 reorders the ordering of CryptoAlgorithmIdentifier in SerializedScriptValue,
2010         which introduces backward compatibility issues with CryptoKey objects stored in the
2011         IndexedDB. Hence, we should restore it back.
2012
2013         No tests.
2014
2015         * bindings/js/SerializedScriptValue.cpp:
2016
2017 2017-06-21  Daniel Bates  <dabates@apple.com>
2018
2019         Change FrameLoadRequest from a struct to a class
2020
2021         FrameLoadRequest is underutilizing the purpose of a struct - default visibility of
2022         members is public, as FrameLoadRequest explicitly groups its members under public:
2023         or private: sections. Maybe in the future we can make FrameLoadRequest a struct
2024         with only public members. For now, we should consider FrameLoadRequest a class.
2025
2026         * loader/FormSubmission.h:
2027         * loader/FrameLoadRequest.h:
2028         * loader/FrameLoader.h:
2029         * page/Chrome.h:
2030         * page/ChromeClient.h:
2031         * replay/UserInputBridge.h:
2032
2033 2017-06-21  Daewoong Jang  <daewoong.jang@navercorp.com>
2034
2035         Compiler error while building with !HAVE(ACCESSIBILITY)
2036         https://bugs.webkit.org/show_bug.cgi?id=173670
2037
2038         Reviewed by Chris Fleizach.
2039
2040         * accessibility/AXObjectCache.h:
2041         (WebCore::AXObjectCache::getOrCreate):
2042         (WebCore::AXObjectCache::childrenChanged):
2043
2044 2017-06-21  Antoine Quint  <graouts@apple.com>
2045
2046         Build fix.
2047
2048         Reviewed by Tim "Mr. T" Horton.
2049
2050         * dom/ScriptedAnimationController.cpp:
2051         (WebCore::ScriptedAnimationController::logSuspendCount):
2052         * page/Page.cpp:
2053         (WebCore::Page::suspendScriptedAnimations):
2054         (WebCore::Page::resumeScriptedAnimations):
2055
2056 2017-06-21  Antoine Quint  <graouts@apple.com>
2057
2058         Ensure DRT always logs rAF suspension debugging code
2059         https://bugs.webkit.org/show_bug.cgi?id=173681
2060
2061         Reviewed by Tim "Mr. T" Horton.
2062
2063         Instead of using a setting to check whether we should log information related to rAF
2064         callbacks being suspended with WK1, we now check whether we're using in DRT to avoid
2065         any potential issue with settings being in the incorrect state when a test is run.
2066
2067         * dom/ScriptedAnimationController.cpp:
2068         (WebCore::ScriptedAnimationController::logSuspendCount):
2069         * page/Page.cpp:
2070         (WebCore::Page::suspendScriptedAnimations):
2071         (WebCore::Page::resumeScriptedAnimations):
2072         * page/Settings.in:
2073         * platform/RuntimeApplicationChecks.h:
2074         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
2075         (WebCore::MacApplication::isDumpRenderTree):
2076
2077 2017-06-21  Chris Dumez  <cdumez@apple.com>
2078
2079         Allow constructing a WTF:Function from a function pointer
2080         https://bugs.webkit.org/show_bug.cgi?id=173660
2081
2082         Reviewed by Alex Christensen.
2083
2084         Construct WTF:Function directly from a function pointer when possible
2085         instead of constructing a lambda to do so.
2086
2087         * Modules/encryptedmedia/InitDataRegistry.cpp:
2088         (WebCore::InitDataRegistry::InitDataRegistry):
2089         * page/Page.cpp:
2090         * page/mac/PageMac.mm:
2091         (WebCore::Page::platformInitialize):
2092         * platform/cf/MainThreadSharedTimerCF.cpp:
2093         (WebCore::setupPowerObserver):
2094         * platform/mac/WebCoreNSURLExtras.mm:
2095         * rendering/SimpleLineLayout.cpp:
2096         (WebCore::SimpleLineLayout::canUseForWithReason):
2097         * workers/Worker.cpp:
2098         (WebCore::Worker::Worker):
2099
2100 2017-06-21  Antoine Quint  <graouts@apple.com>
2101
2102         CSS text properties affect <video> shadow root
2103         https://bugs.webkit.org/show_bug.cgi?id=173664
2104         <rdar://problem/32904328>
2105
2106         Reviewed by Dean Jackson.
2107
2108         Ensure that we reset all inheritable styles back to their initial value for media shadow roots.
2109
2110         Test: media/modern-media-controls/time-label/time-label-inherited-text-indent.html
2111
2112         * Modules/modern-media-controls/controls/media-controls.css:
2113         (.media-controls-container):
2114
2115 2017-06-20  Simon Fraser  <simon.fraser@apple.com>
2116
2117         Remove WILL_REVEAL_EDGE_EVENTS code
2118         https://bugs.webkit.org/show_bug.cgi?id=173632
2119
2120         Reviewed by Sam Weinig, Beth Dakin.
2121
2122         Remove will-reveal-edge events, which never took off.
2123
2124         * dom/Document.cpp:
2125         (WebCore::Document::clearScriptedAnimationController):
2126         (WebCore::Document::sendWillRevealEdgeEventsIfNeeded): Deleted.
2127         * dom/Document.h:
2128         * dom/GlobalEventHandlers.idl:
2129         * html/HTMLBodyElement.idl:
2130         * html/HTMLFrameSetElement.idl:
2131         * page/FrameView.cpp:
2132         (WebCore::FrameView::scrollPositionChanged):
2133         * rendering/RenderLayer.cpp:
2134         (WebCore::RenderLayer::scrollTo):
2135
2136 2017-06-21  Daniel Bates  <dabates@apple.com>
2137
2138         Cleanup FrameLoadRequest
2139         https://bugs.webkit.org/show_bug.cgi?id=173564
2140         <rdar://problem/32903570>
2141
2142         Reviewed by Brent Fulgham.
2143
2144         FrameLoadRequest has too many constructors. Use default values to reduce the number of
2145         constructors. Have FrameLoadRequest hold a Ref<SecurityOrigin> instead of a RefPtr<SecurityOrigin>
2146         as FrameLoadRequest must always hold a valid SecurityOrigin, the security origin of the
2147         document that initiated the request.
2148
2149         * inspector/InspectorFrontendClientLocal.cpp:
2150         (WebCore::InspectorFrontendClientLocal::openInNewTab): Explicitly pass the null-string for
2151         the target frame name as we do not have one. Use C++11 brace initialization syntax and ASCIILiteral().
2152         Rename local variable from request to frameLoadRequest to better describe its purpose. Fix up
2153         FIXME comment added in r105600 to better describe the issue we should fix as the code as
2154         changed since the FIXME was added.
2155         * inspector/InspectorPageAgent.cpp:
2156         (WebCore::InspectorPageAgent::navigate): No need to pass ShouldReplaceDocumentIfJavaScriptURL::ReplaceDocumentIfJavaScriptURL
2157         now that the FrameLoadRequests constructor uses this policy by default. Use C++11 brace
2158         initialization syntax and ASCIILiteral(). Rename local variable from frameRequest to frameLoadRequest
2159         to better describe its purpose.
2160         * loader/FrameLoadRequest.cpp:
2161         (WebCore::FrameLoadRequest::FrameLoadRequest): Use C++11 brace initialization syntax.
2162         * loader/FrameLoadRequest.h: Remove many constructor overloads. Changed m_requester from
2163         RefPtr<SecurityOrigin> to Ref<SecurityOrigin> as we can never be instantiated with a null
2164         SecurityOrigin. Moved m_shouldCheckNewWindowPolicy to be under ShouldOpenExternalURLsPolicy
2165         to reduce the size of the class by 8 bytes.
2166         * loader/FrameLoadRequest.h:
2167         (WebCore::FrameLoadRequest::FrameLoadRequest): Added copy constructor as we must use Ref::copyRef()
2168         to copy the Ref<SecurityOrigin>.
2169         (WebCore::FrameLoadRequest::requester): Return a const SecurityOrigin& instead of a const SecurityOrigin*.
2170         * loader/FrameLoader.cpp:
2171         (WebCore::FrameLoader::urlSelected): Update now that the order of the ShouldReplaceDocumentIfJavaScriptURL
2172         and ShouldOpenExternalURLsPolicy arguments in the FrameLoadRequest constructor has changed.
2173         (WebCore::FrameLoader::loadURLIntoChildFrame): Ditto. Also use C++11 brace initialization syntax
2174         and ASCIILiteral().
2175         (WebCore::FrameLoader::loadFrameRequest): Update code now that FrameLoadRequest::requester() returns a
2176         SecurityOrigin& instead of a SecurityOrigin*. Use C++11 brace initialization syntax.
2177         * loader/NavigationScheduler.cpp:
2178         (WebCore::NavigationScheduler::scheduleLocationChange): Use C++11 brace initialization syntax.
2179         Rename local variable from frameRequest to frameLoadRequest to better describe its purpose.
2180         * page/ContextMenuController.cpp:
2181         (WebCore::openNewWindow):
2182         (WebCore::ContextMenuController::contextMenuItemSelected): ove FrameLoadRequest instantiation
2183         into a local variable and use C++11 brace initialization syntax to make it easier to identify
2184         the arguments passed to FrameLoader::loadFrameRequest().
2185         * page/DOMWindow.cpp:
2186         (WebCore::DOMWindow::createWindow): Update now that the order of the ShouldReplaceDocumentIfJavaScriptURL
2187         and ShouldOpenExternalURLsPolicy arguments in the FrameLoadRequest constructor has changed.
2188         Use C++11 brace initialization syntax and ASCIILiteral(). Rename some local variables to better
2189         describe their purpose.
2190
2191 2017-06-20  Simon Fraser  <simon.fraser@apple.com>
2192
2193         svgPath.getTotalLength() freezes webkit
2194         https://bugs.webkit.org/show_bug.cgi?id=173566
2195         <rdar://problem/32866731>
2196
2197         Reviewed by Dean Jackson.
2198
2199         Ensure that curveLength() progresses by making split() return a bool indicating
2200         whether either of the resulting curves are the same as the original. This can happen
2201         when midPoint() on two close points returns a point that is the same as one of the
2202         arguments because of floating-point precision limitations.
2203
2204         Test: svg/custom/path-getTotalLength-hang.html
2205
2206         * platform/graphics/PathTraversalState.cpp:
2207         (WebCore::QuadraticBezier::operator ==):
2208         (WebCore::QuadraticBezier::split):
2209         (WebCore::CubicBezier::operator ==):
2210         (WebCore::CubicBezier::split):
2211         (WebCore::curveLength):
2212
2213 2017-06-21  Youenn Fablet  <youenn@apple.com>
2214
2215         Fix AVVideoCaptureSource frameRate setter and getter
2216         https://bugs.webkit.org/show_bug.cgi?id=173637
2217
2218         Reviewed by Eric Carlson.
2219
2220         Covered by manual testing.
2221
2222         Using activeVideoMaxFrameDuration to get the frame rate.
2223         Setting the frame rate according the given vale if in the allowed range.
2224
2225         * platform/mediastream/mac/AVVideoCaptureSource.h:
2226         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2227         (WebCore::AVVideoCaptureSource::updateSettings):
2228         (WebCore::AVVideoCaptureSource::applyFrameRate):
2229         (WebCore::AVVideoCaptureSource::applySizeAndFrameRate):
2230         (WebCore::AVVideoCaptureSource::shutdownCaptureSession):
2231         (WebCore::AVVideoCaptureSource::processNewFrame):
2232         (WebCore::AVVideoCaptureSource::updateFramerate): Deleted.
2233
2234 2017-06-21  Youenn Fablet  <youenn@apple.com>
2235
2236         Refresh libwebrtc code up to a87675d4a160e2c49c3e754cd9ca291d6c8f36ae
2237         https://bugs.webkit.org/show_bug.cgi?id=173602
2238
2239         Reviewed by Eric Carlson.
2240
2241         No feature change.
2242
2243         Updated according small libwebrtc API changes.
2244
2245         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2246         (WebCore::configurationFromMediaEndpointConfiguration):
2247         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
2248         (WebCore::RealtimeIncomingVideoSource::pixelBufferFromVideoFrame):
2249         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
2250         (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
2251         (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
2252
2253 2017-06-21  Sam Weinig  <sam@webkit.org>
2254
2255         Add support for structured serialization of CSS Geometry types
2256         https://bugs.webkit.org/show_bug.cgi?id=173631
2257
2258         Reviewed by Simon Fraser.
2259
2260         Tests: imported/w3c/web-platform-tests/css/geometry-1/structured-serialization.html
2261
2262         Adds support for serializing the new geometry types as specified by:
2263         https://drafts.fxtf.org/geometry-1/#structured-serialization
2264
2265         * WebCore.xcodeproj/project.pbxproj:
2266         Move a few custom bindings into the "GC / Wrapping Only" since they have no more custom operations or attributes.
2267
2268         * bindings/js/SerializedScriptValue.cpp:
2269         (WebCore::CloneSerializer::dumpDOMPoint):
2270         (WebCore::CloneSerializer::dumpDOMRect):
2271         (WebCore::CloneSerializer::dumpDOMMatrix):
2272         (WebCore::CloneSerializer::dumpDOMQuad):
2273         (WebCore::CloneSerializer::dumpIfTerminal):
2274         (WebCore::CloneDeserializer::getJSValue):
2275         (WebCore::CloneDeserializer::readDOMPoint):
2276         (WebCore::CloneDeserializer::readDOMMatrix):
2277         (WebCore::CloneDeserializer::readDOMRect):
2278         (WebCore::CloneDeserializer::readDOMPointInit):
2279         (WebCore::CloneDeserializer::readDOMQuad):
2280         (WebCore::CloneDeserializer::readTerminal):
2281         Add serialization/deserialization of the geometry types.
2282
2283         * css/DOMMatrix.cpp:
2284         (WebCore::DOMMatrix::DOMMatrix):
2285         * css/DOMMatrix.h:
2286         (WebCore::DOMMatrix::create):
2287         * css/DOMMatrixReadOnly.cpp:
2288         (WebCore::DOMMatrixReadOnly::DOMMatrixReadOnly):
2289         * css/DOMMatrixReadOnly.h:
2290         (WebCore::DOMMatrixReadOnly::create):
2291         Add create functions and constructors that take a TransformationMatrix by r-value reference
2292         so they can be moved into the DOM type.
2293
2294 2017-06-21  Andreas Kling  <akling@apple.com>
2295
2296         [iOS] Ensure that GraphicsServices is initialized before calling GSFontPurgeFontCache().
2297         https://bugs.webkit.org/show_bug.cgi?id=173616
2298         <rdar://problem/30780050>
2299
2300         Reviewed by Chris Dumez.
2301
2302         Fix for crash in GSFontPurgeFontCache() seen in apps embedding WebKit.
2303         Ensure GSFontInitialize() has been called first, since the former depends on state
2304         set up by this function.
2305
2306         * page/cocoa/MemoryReleaseCocoa.mm:
2307         (WebCore::platformReleaseMemory):
2308         * platform/spi/ios/GraphicsServicesSPI.h:
2309
2310 2017-06-21  Antoine Quint  <graouts@apple.com>
2311
2312         Add logging to identify when the Page suspends scripted animations
2313         https://bugs.webkit.org/show_bug.cgi?id=173626
2314
2315         Reviewed by Tim Horton.
2316
2317         We have a longstanding issue that some media/modern-media-controls tests time out due to
2318         requestAnimationFrame callbacks not being serviced, which is tracked by webkit.org/b/173628.
2319         We added some logging to identify when ScriptedAnimationController would get suspended in
2320         webkit.org/b/173326. This logging points to the fact that the reason rAF callbacks aren't
2321         serviced is because Document::requestAnimationFrame() suspends rAF when the page reports
2322         that scripted animations ought to be suspended, which is true when m_scriptedAnimationsSuspended
2323         is true. This patch adds logging that tracks when this flag is set, provided a new setting
2324         shouldLogScriptedAnimationControllerSuspensionChange is true.
2325
2326         * dom/ScriptedAnimationController.cpp:
2327         (WebCore::ScriptedAnimationController::logSuspendCount):
2328         * page/Page.cpp:
2329         (WebCore::Page::suspendScriptedAnimations):
2330         (WebCore::Page::resumeScriptedAnimations):
2331         * page/Settings.in:
2332
2333 2017-06-21  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2334
2335         [Curl] Extract CurlDownloadManager as shared background task handler
2336         https://bugs.webkit.org/show_bug.cgi?id=173557
2337
2338         Curl resource handling should be shared by other part of Curl
2339         network stack. CurlDownloadManager is extracted as stand alone
2340         CurlManager singleton class to be ready for others
2341         (i.e. ResourceHandle).
2342
2343         Reviewed by Alex Christensen.
2344
2345         * PlatformWinCairo.cmake:
2346         * platform/network/curl/CookieJarCurl.cpp:
2347         (WebCore::setCookiesFromDOM):
2348         (WebCore::cookiesForSession):
2349         * platform/network/curl/CurlDownload.cpp:
2350         (WebCore::CurlDownload::init):
2351         (WebCore::CurlDownload::start):
2352         (WebCore::CurlDownload::cancel):
2353         (WebCore::CurlDownload::didReceiveHeader):
2354         (WebCore::CurlDownload::handleCurlMsg):
2355         (WebCore::CurlDownloadManager::CurlDownloadManager): Deleted.
2356         (WebCore::CurlDownloadManager::~CurlDownloadManager): Deleted.
2357         (WebCore::CurlDownloadManager::add): Deleted.
2358         (WebCore::CurlDownloadManager::remove): Deleted.
2359         (WebCore::CurlDownloadManager::getActiveDownloadCount): Deleted.
2360         (WebCore::CurlDownloadManager::getPendingDownloadCount): Deleted.
2361         (WebCore::CurlDownloadManager::startThreadIfNeeded): Deleted.
2362         (WebCore::CurlDownloadManager::stopThread): Deleted.
2363         (WebCore::CurlDownloadManager::stopThreadIfIdle): Deleted.
2364         (WebCore::CurlDownloadManager::updateHandleList): Deleted.
2365         (WebCore::CurlDownloadManager::addToCurl): Deleted.
2366         (WebCore::CurlDownloadManager::removeFromCurl): Deleted.
2367         (WebCore::CurlDownloadManager::downloadThread): Deleted.
2368         * platform/network/curl/CurlDownload.h:
2369         (WebCore::CurlDownloadManager::getMultiHandle): Deleted.
2370         (WebCore::CurlDownloadManager::runThread): Deleted.
2371         (WebCore::CurlDownloadManager::setRunThread): Deleted.
2372         * platform/network/curl/CurlManager.cpp: Added.
2373         (WebCore::CurlManager::CurlManager):
2374         (WebCore::CurlManager::~CurlManager):
2375         (WebCore::CurlManager::add):
2376         (WebCore::CurlManager::remove):
2377         (WebCore::CurlManager::getActiveCount):
2378         (WebCore::CurlManager::getPendingCount):
2379         (WebCore::CurlManager::startThreadIfNeeded):
2380         (WebCore::CurlManager::stopThread):
2381         (WebCore::CurlManager::stopThreadIfIdle):
2382         (WebCore::CurlManager::updateHandleList):
2383         (WebCore::CurlManager::addToCurl):
2384         (WebCore::CurlManager::removeFromCurl):
2385         (WebCore::CurlManager::workerThread):
2386         (WebCore::CurlUtils::getEffectiveURL):
2387         (WebCore::CurlSharedResources::mutexFor):
2388         (WebCore::CurlSharedResources::lock):
2389         (WebCore::CurlSharedResources::unlock):
2390         * platform/network/curl/CurlManager.h: Added.
2391         (WebCore::CurlManager::singleton):
2392         (WebCore::CurlManager::getCurlShareHandle):
2393         (WebCore::CurlManager::getMultiHandle):
2394         (WebCore::CurlManager::runThread):
2395         (WebCore::CurlManager::setRunThread):
2396         * platform/network/curl/ResourceHandleManager.cpp:
2397         (WebCore::ResourceHandleManager::ResourceHandleManager):
2398         (WebCore::ResourceHandleManager::~ResourceHandleManager):
2399         (WebCore::handleLocalReceiveResponse):
2400         (WebCore::getProtectionSpace):
2401         (WebCore::headerCallback):
2402         (WebCore::ResourceHandleManager::downloadTimerCallback):
2403         (WebCore::getCurlEffectiveURL): Deleted.
2404         (WebCore::sharedResourceMutex): Deleted.
2405         (WebCore::curl_lock_callback): Deleted.
2406         (WebCore::curl_unlock_callback): Deleted.
2407         (WebCore::ResourceHandleManager::getCurlShareHandle): Deleted.
2408         * platform/network/curl/ResourceHandleManager.h:
2409
2410 2017-06-21  Jeremy Jones  <jeremyj@apple.com>
2411
2412         Include audio/vnd.wave as a valid mime-type for wav files.
2413         https://bugs.webkit.org/show_bug.cgi?id=173635
2414         rdar://problem/32656568
2415
2416         Reviewed by Eric Carlson.
2417
2418         audio/vnd.wave is a valid mime-type for wav files per https://tools.ietf.org/html/rfc2361
2419
2420         Updated test and test results:
2421         LayoutTests/media/media-can-play-wav-audio.html
2422
2423         * platform/MIMETypeRegistry.cpp:
2424         (WebCore::initializeSupportedImageMIMETypes):
2425         (WebCore::mimeTypeAssociationMap):
2426         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2427         (WebCore::MediaPlayerPrivateAVFoundation::staticMIMETypeList):
2428         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2429         (WebCore::mimeTypeSet):
2430
2431 2017-06-21  Chris Fleizach  <cfleizach@apple.com>
2432
2433         AX: Cannot call setValue() on contenteditable or ARIA text controls
2434         https://bugs.webkit.org/show_bug.cgi?id=173520
2435
2436         Reviewed by Ryosuke Niwa.
2437
2438         Add support for changing the value of a contenteditable and any other aria text control in setValue().
2439  
2440         Test: accessibility/set-value-editable-types.html
2441
2442         * accessibility/AccessibilityRenderObject.cpp:
2443         (WebCore::AccessibilityRenderObject::setValue):
2444
2445 2017-06-20  Zan Dobersek  <zdobersek@igalia.com>
2446
2447         [GCrypt] Implement CryptoKeyEC SPKI imports
2448         https://bugs.webkit.org/show_bug.cgi?id=172927
2449
2450         Reviewed by Jiewen Tan, Michael Catanzaro and Carlos Garcia Campos.
2451
2452         No new tests -- affected tests are now passing and are unskipped.
2453
2454         Implement libgcrypt-based support for SPKI imports of EC keys.
2455
2456         Using libtasn1 through the utility functions and wrappers, the given key data
2457         is decoded against the SubjectPublicKeyInfo ASN.1 definition. The algorithm
2458         member is then properly validated, making sure that the key algorithm idenfitier
2459         is supported and that the algorithm parameters specify the correct EC curve.
2460
2461         The public key bit string is then retrieved and validated, ensuring it represents
2462         an uncompressed EC point that is of valid size for the specified EC curve. The
2463         point is then tested through an EC context to make sure it's positioned on the
2464         specified EC curve.
2465
2466         Finally, the curve name and uncompressed point data are embedded into a
2467         `public-key` s-expression that will be used through the libgcrypt API. This is
2468         then used, along with other information, to create a valid CryptoKeyEC object.
2469
2470         * PlatformGTK.cmake: Use LIBTASN1_INCLUDE_DIRECTORIES and LIBTASN1_LIBRARIES.
2471         * PlatformWPE.cmake: Ditto.
2472         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
2473         (WebCore::supportedAlgorithmIdentifier):
2474         (WebCore::curveForIdentifier):
2475         (WebCore::CryptoKeyEC::platformImportSpki):
2476
2477 2017-06-20  Devin Rousso  <drousso@apple.com>
2478
2479         WebGPU contexts should have a back reference to the canvas element
2480         https://bugs.webkit.org/show_bug.cgi?id=173633
2481
2482         Reviewed by Jon Lee.
2483
2484         No tests added, as this is already implemented within other canvas types.
2485
2486         * html/canvas/WebGPURenderingContext.idl:
2487
2488 2017-06-20  Youenn Fablet  <youenn@apple.com>
2489
2490         WebAudioSourceProvider should be thread safe ref counted
2491         https://bugs.webkit.org/show_bug.cgi?id=173623
2492
2493         Reviewed by Eric Carlson.
2494
2495         No observable change of behavior.
2496
2497         * platform/mediastream/WebAudioSourceProvider.h:
2498
2499 2017-06-20  Yoav Weiss  <yoav@yoav.ws>
2500
2501         [preload] Turn on preload's feature flag by default.
2502         https://bugs.webkit.org/show_bug.cgi?id=173139
2503
2504         Reviewed by Youenn Fablet.
2505
2506         Turn on the runtime enabled feature flag for link preload by default.
2507
2508         No new tests as this just turns on a feature that was already on-by-default for tests.
2509
2510         * page/RuntimeEnabledFeatures.h:
2511
2512 2017-06-20  Myles C. Maxfield  <mmaxfield@apple.com>
2513
2514         Disable font variations on macOS Sierra and iOS 10
2515         https://bugs.webkit.org/show_bug.cgi?id=173618
2516         <rdar://problem/32879164>
2517
2518         Reviewed by Jon Lee.
2519
2520         On macOS Sierra and iOS 10, there are some platform problems involved with font variations. They
2521         were previously enabled on those OSes just as a preview development tool. These platform bugs have
2522         been fixed in macOS High Sierra and iOS 11, so we should align our feature flags with the eventual
2523         configurations.
2524
2525         * Configurations/FeatureDefines.xcconfig:
2526         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2527         (WebCore::defaultVariationValues):
2528         (WebCore::preparePlatformFont):
2529
2530 2017-06-20  Devin Rousso  <drousso@apple.com>
2531
2532         Web Inspector: Send context attributes for tracked canvases
2533         https://bugs.webkit.org/show_bug.cgi?id=173327
2534
2535         Reviewed by Joseph Pecoraro.
2536
2537         Test: inspector/canvas/context-attributes.html
2538
2539         * inspector/InspectorCanvasAgent.cpp:
2540         (WebCore::InspectorCanvasAgent::buildObjectForCanvas):
2541
2542 2017-06-20  Myles C. Maxfield  <mmaxfield@apple.com>
2543
2544         [Cocoa] The system Japanese font cannot be italicized
2545         https://bugs.webkit.org/show_bug.cgi?id=173300
2546         <rdar://problem/31805407>
2547
2548         Reviewed by Ryosuke Niwa.
2549
2550         Items in the system font cascade list may lie about whether or not they support italics.
2551         In order to get the truth, we need to use the physical font underlying the font in question,
2552         because this one won't lie. Then, we can interrogate this physical font about its traits
2553         in order to synthesize italics correctly.
2554
2555         Test: fast/text/system-font-japanese-synthetic-italic.html
2556
2557         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2558         (WebCore::lookupFallbackFont):
2559         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
2560         (WebCore::FontFamilySpecificationCoreText::fontRanges):
2561
2562 2017-06-20  Chris Dumez  <cdumez@apple.com>
2563
2564         Use WTF::Function instead of std::function in more places in WebCore/
2565         https://bugs.webkit.org/show_bug.cgi?id=173583
2566
2567         Reviewed by Darin Adler.
2568
2569         Use WTF::Function instead of std::function in more places in WebCore/ to
2570         reduce copying.
2571
2572         * page/Page.cpp:
2573         * platform/HysteresisActivity.h:
2574         (WebCore::HysteresisActivity::HysteresisActivity):
2575         * platform/Logging.cpp:
2576         (WebCore::registerNotifyCallback):
2577         * platform/Logging.h:
2578         * platform/MainThreadSharedTimer.cpp:
2579         (WebCore::MainThreadSharedTimer::setFiredFunction):
2580         * platform/MainThreadSharedTimer.h:
2581         * platform/PlatformPasteboard.h:
2582         * platform/ScopeGuard.h:
2583         (WebCore::ScopeGuard::ScopeGuard):
2584         (WebCore::ScopeGuard::enable):
2585         * platform/ScrollAnimationSmooth.cpp:
2586         (WebCore::ScrollAnimationSmooth::ScrollAnimationSmooth):
2587         * platform/ScrollAnimationSmooth.h:
2588         * platform/SharedTimer.h:
2589         * platform/audio/PlatformMediaSessionManager.cpp:
2590         (WebCore::PlatformMediaSessionManager::currentSessionsMatching):
2591         * platform/audio/PlatformMediaSessionManager.h:
2592         * platform/cf/MainThreadSharedTimerCF.cpp:
2593         (WebCore::setupPowerObserver):
2594         * platform/cf/RunLoopObserver.h:
2595         (WebCore::RunLoopObserver::RunLoopObserver):
2596         * platform/graphics/GraphicsContext.h:
2597         * platform/graphics/GraphicsLayer.cpp:
2598         (WebCore::GraphicsLayer::traverse):
2599         * platform/graphics/GraphicsLayer.h:
2600         * platform/graphics/MediaPlayer.cpp:
2601         (WebCore::addMediaEngine):
2602         * platform/graphics/MediaPlayer.h:
2603         * platform/graphics/Path.h:
2604         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2605         (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted):
2606         (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
2607         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
2608         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2609         (WebCore::MediaPlayerPrivateAVFoundation::Notification::Notification):
2610         (WebCore::MediaPlayerPrivateAVFoundation::Notification::function):
2611         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2612         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2613         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2614         (WebCore::runWithoutAnimations):
2615         * platform/graphics/cocoa/IOSurface.h:
2616         * platform/graphics/cocoa/IOSurface.mm:
2617         (WebCore::IOSurface::convertToFormat):
2618         * platform/graphics/gstreamer/MainThreadNotifier.h:
2619         * platform/graphics/gstreamer/MediaPlayerRequestInstallMissingPluginsCallback.h:
2620         (WebCore::MediaPlayerRequestInstallMissingPluginsCallback::create):
2621         (WebCore::MediaPlayerRequestInstallMissingPluginsCallback::MediaPlayerRequestInstallMissingPluginsCallback):
2622         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2623         (WebCore::GraphicsContext::drawWithoutShadow):
2624         (WebCore::GraphicsContext::drawWithShadow):
2625         * platform/gtk/PasteboardHelper.cpp:
2626         (WebCore::ClipboardSetData::ClipboardSetData):
2627         (WebCore::PasteboardHelper::writeClipboardContents):
2628         * platform/gtk/PasteboardHelper.h:
2629         * platform/gtk/PlatformPasteboardGtk.cpp:
2630         (WebCore::PlatformPasteboard::writeToClipboard):
2631         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
2632         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2633         (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline):
2634         (WebVideoFullscreenInterfaceAVKit::fullscreenMayReturnToInline):
2635         * platform/mac/PowerObserverMac.cpp:
2636         (WebCore::PowerObserver::PowerObserver):
2637         * platform/mac/PowerObserverMac.h:
2638         * platform/mac/WebCoreNSURLExtras.mm:
2639         (WebCore::isSecondLevelDomainNameAllowedByTLDRules):
2640         * platform/mediastream/CaptureDeviceManager.cpp:
2641         (CaptureDeviceManager::addCaptureDeviceChangedObserver):
2642         * platform/mediastream/CaptureDeviceManager.h:
2643         * platform/mediastream/RealtimeMediaSource.cpp:
2644         (WebCore::RealtimeMediaSource::scheduleDeferredTask):
2645         * platform/mediastream/RealtimeMediaSource.h:
2646         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
2647         (-[WebAVAudioSessionAvailableInputsListener initWithCallback:]):
2648         * platform/mediastream/mac/CoreAudioCaptureSource.h:
2649         * platform/mock/ScrollAnimatorMock.cpp:
2650         (WebCore::ScrollAnimatorMock::ScrollAnimatorMock):
2651         * platform/mock/ScrollAnimatorMock.h:
2652         * platform/network/CookieStorage.h:
2653         * platform/network/NetworkStateNotifier.cpp:
2654         (WebCore::NetworkStateNotifier::addNetworkStateChangeListener):
2655         * platform/network/NetworkStateNotifier.h:
2656         * platform/network/NetworkStorageSession.cpp:
2657         (WebCore::NetworkStorageSession::forEach):
2658         * platform/network/NetworkStorageSession.h:
2659         * platform/network/cf/CookieStorageCFNet.cpp:
2660         (WebCore::cookieChangeCallbackMap):
2661         (WebCore::startObservingCookieChanges):
2662         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
2663         (WebCore::callOnMainThreadAndWait):
2664         * platform/network/mac/CookieStorageMac.mm:
2665         (-[WebCookieStorageObjCAdapter startListeningForCookieChangeNotificationsWithCallback:]):
2666         (WebCore::startObservingCookieChanges):
2667         * platform/network/soup/CookieStorageSoup.cpp:
2668         (WebCore::startObservingCookieChanges):
2669         * platform/network/soup/SoupNetworkSession.cpp:
2670         (WebCore::SoupNetworkSession::checkTLSErrors):
2671         * platform/network/soup/SoupNetworkSession.h:
2672         * platform/sql/SQLiteDatabase.cpp:
2673         (WebCore::destroyCollationFunction):
2674         (WebCore::callCollationFunction):
2675         (WebCore::SQLiteDatabase::setCollationFunction):
2676         * platform/sql/SQLiteDatabase.h:
2677         * rendering/RenderLayerBacking.cpp:
2678         (WebCore::traverseVisibleNonCompositedDescendantLayers):
2679         * rendering/RenderListBox.cpp:
2680         (WebCore::RenderListBox::paintItem):
2681         * rendering/RenderListBox.h:
2682         * rendering/line/BreakingContext.h:
2683         (WebCore::BreakingContext::InlineIteratorHistory::push):
2684         (WebCore::BreakingContext::InlineIteratorHistory::update):
2685         * workers/Worker.cpp:
2686         (WebCore::Worker::Worker):
2687         * workers/WorkerRunLoop.cpp:
2688
2689 2017-06-20  Ryan Haddad  <ryanhaddad@apple.com>
2690
2691         Unreviewed, rolling out r218524.
2692
2693         This change broke internal builds.
2694
2695         Reverted changeset:
2696
2697         "[Cocoa] The system Japanese font cannot be italicized"
2698         https://bugs.webkit.org/show_bug.cgi?id=173300
2699         http://trac.webkit.org/changeset/218524
2700
2701 2017-06-20  Daniel Bates  <dabates@apple.com>
2702
2703         Have FrameLoadRequest takes a Frame& instead of a Frame*
2704         https://bugs.webkit.org/show_bug.cgi?id=173614
2705         <rdar://problem/32884890>
2706
2707         Reviewed by Brent Fulgham.
2708
2709         * loader/ContentFilter.cpp:
2710         (WebCore::ContentFilter::handleProvisionalLoadFailure):
2711         * loader/FrameLoadRequest.cpp:
2712         (WebCore::FrameLoadRequest::FrameLoadRequest):
2713         * loader/FrameLoadRequest.h:
2714         * page/DragController.cpp:
2715         (WebCore::DragController::performDragOperation):
2716
2717 2017-06-20  Daniel Bates  <dabates@apple.com>
2718
2719         Skip Content Security Policy check for a media request using standard schemes initiated from
2720         an element in user agent shadow tree
2721         https://bugs.webkit.org/show_bug.cgi?id=155505
2722         <rdar://problem/25169452>
2723
2724         Reviewed by Brent Fulgham.
2725
2726         This change makes the following tests pass on iOS 11:
2727             http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-video.html
2728             http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-audio.html
2729
2730         * loader/MediaResourceLoader.cpp:
2731         (WebCore::MediaResourceLoader::requestResource):
2732         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2733         (WebCore::WebCoreAVFResourceLoader::startLoading):
2734
2735 2017-06-20  Andreas Kling  <akling@apple.com>
2736
2737         Remove no-op calls to purge SQLite caches on memory pressure.
2738         <https://webkit.org/b/173604>
2739
2740         Reviewed by Chris Dumez.
2741
2742         The implementation of _sqlite3_purgeEligiblePagerCacheMemory() is empty
2743         since a few releases ago, so there's no point in calling it.
2744
2745         * page/MemoryRelease.cpp:
2746         (WebCore::registerMemoryReleaseNotifyCallbacks):
2747         (WebCore::registerSQLiteMemoryPressureHandler): Deleted.
2748         * page/MemoryRelease.h:
2749         * page/cocoa/MemoryReleaseCocoa.mm:
2750         (WebCore::platformReleaseMemory):
2751         (WebCore::registerSQLiteMemoryPressureHandler): Deleted.
2752         * platform/sql/SQLiteDatabase.cpp:
2753         (WebCore::initializeSQLiteIfNecessary):
2754
2755 2017-06-20  Devin Rousso  <drousso@apple.com>
2756
2757         Web Inspector: add console messages for WebGL shader compile and program link errors/warnings
2758         https://bugs.webkit.org/show_bug.cgi?id=143236
2759         <rdar://problem/20352149>
2760
2761         Reviewed by Dean Jackson.
2762
2763         Test: fast/canvas/webgl/shader-compile-logging.html
2764
2765         * html/canvas/WebGLRenderingContextBase.h:
2766         * html/canvas/WebGLRenderingContextBase.cpp:
2767         (WebCore::WebGLRenderingContextBase::checkFramebufferStatus):
2768         (WebCore::WebGLRenderingContextBase::compileShader):
2769         (WebCore::WebGLRenderingContextBase::recycleContext):
2770         (WebCore::WebGLRenderingContextBase::checkTextureCompleteness):
2771         (WebCore::WebGLRenderingContextBase::printToConsole):
2772         (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
2773         (WebCore::WebGLRenderingContextBase::synthesizeGLError):
2774         (WebCore::WebGLRenderingContextBase::printGLErrorToConsole): Deleted.
2775         (WebCore::WebGLRenderingContextBase::printWarningToConsole): Deleted.
2776         (WebCore::WebGLRenderingContextBase::printGLWarningToConsole): Deleted.
2777         Unify console logging helper functions to all follow the same path. Additionally, errors
2778         now generate stack traces. Shader compilation errors are now logged as well.
2779
2780         * dom/Document.h:
2781         * dom/Document.cpp:
2782         (WebCore::Document::addConsoleMessage):
2783         * dom/ScriptExecutionContext.h:
2784         (WebCore::ScriptExecutionContext::AddConsoleMessageTask::AddConsoleMessageTask):
2785         * page/PageConsoleClient.h:
2786         * page/PageConsoleClient.cpp:
2787         (WebCore::PageConsoleClient::addMessage):
2788         * workers/WorkerGlobalScope.h:
2789         Add new path for logging to the console that accepts a ConsoleMessage.
2790
2791 2017-06-20  Saam Barati  <sbarati@apple.com>
2792
2793         Unreviewed. Try to fix the build after r218594.
2794
2795         * dom/Document.h:
2796
2797 2017-06-20  Matt Lewis  <jlewis3@apple.com>
2798
2799         Unreviewed, rolling out r218530.
2800
2801         This revision caused multiple media stream test crashes on
2802         Debug builds.
2803
2804         Reverted changeset:
2805
2806         "Merge MediaDevicesRequest and MediaDevicesEnumerationRequest
2807         to tighten up code and object lifetime"
2808         https://bugs.webkit.org/show_bug.cgi?id=173527
2809         http://trac.webkit.org/changeset/218530
2810
2811 2017-06-19  Antoine Quint  <graouts@apple.com>
2812
2813         Media document experience with long-loading files is poor
2814         https://bugs.webkit.org/show_bug.cgi?id=173575
2815         <rdar://problem/32178119>
2816
2817         Reviewed by Dean Jackson.
2818
2819         In order to avoid showing media controls at a different size than that of the video when we've
2820         received enough information to determine whether it's audio or video and what the video frame size
2821         is, we do not show any UI until we have enough information to show the controls in their correct
2822         initial state. This works well with local files and fast-loading files, but does not work well with
2823         invalid files, which never load and fail to ever show any UI, and files that load slowly where there
2824         is no visible feedback that content will be visible.
2825
2826         Instead, we now default to showing audio controls in their loading state, which provides a seamless
2827         transition if we will be loading an audio file since the controls are initially in the correct state,
2828         and at least provide feedback that data is loading even if we eventually transition to a video layout.
2829
2830         Additionally, we remove the invalid placard background in case the media is invalid, showing only the
2831         crossed-out play icon in the center of the page in that state.
2832
2833         Tests: media/modern-media-controls/media-documents/media-document-invalid.html
2834                media/modern-media-controls/media-documents/media-document-video-with-initial-audio-layout.html
2835
2836         * Modules/modern-media-controls/controls/media-document.css:
2837         (:host(.media-document)): Remove "visibility: hidden" since we want the media controls to be visible
2838         at all times.
2839         (:host(.media-document.audio)): Add a little padding on the x-axis to ensure audio controls never snap
2840         directly to the edges of the window.
2841         (:host(.media-document.audio.iphone)): Remove the iPhone-specific styling since we moved it to the
2842         general case.
2843         (:host(.media-document.video.invalid) .placard): Remove the background from the invalid placard when
2844         showing invalid media.
2845         (:host(.media-document.ready)): Deleted.
2846         * Modules/modern-media-controls/media/audio-support.js:
2847         (AudioSupport.prototype.syncControl): Make sure we invalidate the media document layout when a media
2848         document's media type changes.
2849         * Modules/modern-media-controls/media/media-controller.js:
2850         (MediaController): Instantiate the controls prior to creating the MediaDocumentController since the
2851         MediaDocumentController will need to access the controls.
2852         * Modules/modern-media-controls/media/media-document-controller.js:
2853         (MediaDocumentController): Set the default layout for media controls for a media document to be audio
2854         and in the waiting state.
2855         (MediaDocumentController.prototype.layout): Toggle the "invalid", "audio" and "video" CSS classes for
2856         the next possible commit to the DOM, provided we have established the media document's media type.
2857         (MediaDocumentController.prototype.handleEvent): Deal with the "play" and "error" events to trigger
2858         a layout.
2859         (MediaDocumentController.prototype._mediaDocumentHasMetadata): Deleted.
2860         (MediaDocumentController.prototype._mediaDocumentHasSize): Deleted.
2861
2862 2017-06-20  Daniel Bates  <dabates@apple.com>
2863
2864         NavigationAction has too many constructors
2865         https://bugs.webkit.org/show_bug.cgi?id=173484
2866
2867         Reviewed by Brady Eidson.
2868
2869         A NavigationAction object is an immutable object that represents the details of a
2870         navigation, including the type of a navigation (e.g. link click), what triggered
2871         the navigation, and the external URL policy to use for the navigation. Over time
2872         the number of NavigationAction constructor overloads (not including copy/move
2873         constructors) has grown to 12 to support different combinations of details.
2874         We can use default values to reduce the number of constructors to 2 (not including
2875         copy/move constructors).
2876
2877         No behavior changed. So, no new tests.
2878
2879         * loader/FrameLoader.cpp:
2880         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): Pass NavigationType::Other when
2881         instantiating NavigationAction.
2882         (WebCore::FrameLoader::loadDifferentDocumentItem): Fix order of arguments now that
2883         the constructor overload that takes a NavigationType takes the Event* as the fourth argument,
2884         not the third. Also, use C++11 brace initialization syntax when instantiating a NavigationAction.
2885         (WebCore::createWindow):
2886         * loader/NavigationAction.cpp: Remove unnecessary #include of header ScriptController.h.
2887         Include header Event.h.
2888         (WebCore::NavigationAction::NavigationAction):
2889         * loader/NavigationAction.h: Forward declare class Event and remove #include of header Event.h.
2890         Make copy constructor, copy assignment operator, move constructor, and move assignment operator
2891         out-of-line to avoid the need to include header Event.h. Export the copy constructor so that it
2892         can be used from WebKit on the Apple Windows port. Move ShouldOpenExternalURLsPolicy to be after
2893         NavigationType to reduce the size of the class by 8 bytes.
2894         (WebCore::NavigationAction::NavigationAction):
2895         * loader/PolicyChecker.cpp: Include header Event.h.
2896         * page/Performance.cpp: Ditto.
2897         * replay/ReplayController.cpp: Ditto.
2898
2899 2017-06-20  Konstantin Tokarev  <annulen@yandex.ru>
2900
2901         Rename OrientationNotifer.h to OrientationNotifier.h
2902         https://bugs.webkit.org/show_bug.cgi?id=173600
2903
2904         Reviewed by Youenn Fablet.
2905
2906         No new tests needed.
2907
2908         * WebCore.xcodeproj/project.pbxproj:
2909         * dom/Document.h:
2910         * platform/OrientationNotifier.h: Renamed from Source/WebCore/platform/OrientationNotifer.h.
2911         * platform/mediastream/mac/AVVideoCaptureSource.h:
2912         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
2913         * testing/Internals.h:
2914
2915 2017-06-20  Konstantin Tokarev  <annulen@yandex.ru>
2916
2917         Remove excessive include directives from WTF
2918         https://bugs.webkit.org/show_bug.cgi?id=173553
2919
2920         Reviewed by Saam Barati.
2921
2922         No new tests needed.
2923
2924         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h:
2925         Added missing include directive.
2926
2927 2017-06-20  Konstantin Tokarev  <annulen@yandex.ru>
2928
2929         Remove excessive include directives from WebCore/dom
2930         https://bugs.webkit.org/show_bug.cgi?id=173591
2931
2932         Reviewed by Darin Adler.
2933
2934         No new tests needed.
2935
2936         * bindings/js/JSCustomElementRegistryCustom.cpp:
2937         * dom/Attr.h:
2938         * dom/ChildListMutationScope.h:
2939         * dom/ContainerNodeAlgorithms.cpp:
2940         * dom/ContainerNodeAlgorithms.h:
2941         * dom/CustomElementRegistry.h:
2942         * dom/DOMRect.h:
2943         * dom/DocumentMarkerController.h:
2944         * dom/ElementIteratorAssertions.h:
2945         * dom/ElementRareData.h:
2946         * dom/EventContext.h:
2947         * dom/EventDispatcher.h:
2948         * dom/ExtensionStyleSheets.h:
2949         * dom/GenericEventQueue.h:
2950         * dom/LiveNodeList.h:
2951         * dom/LoadableClassicScript.h:
2952         * dom/LoadableScript.h:
2953         * dom/MutationCallback.h:
2954         * dom/NativeNodeFilter.h:
2955         * dom/NodeRareData.h:
2956         * dom/PromiseRejectionEvent.h:
2957         * dom/PseudoElement.h:
2958         * dom/Range.h:
2959         * dom/RegisteredEventListener.h:
2960         * dom/RejectedPromiseTracker.cpp:
2961         * dom/ScopedEventQueue.h:
2962         * dom/ScriptElement.h:
2963         * dom/ScriptExecutionContext.h:
2964         * dom/ScriptedAnimationController.cpp:
2965         * dom/ScriptedAnimationController.h:
2966         * dom/SelectorQuery.h:
2967         * dom/StaticNodeList.h:
2968         * dom/StaticRange.h:
2969         * dom/default/PlatformMessagePortChannel.h:
2970         * testing/Internals.cpp:
2971         * workers/WorkerGlobalScope.h:
2972
2973 2017-06-20  Konstantin Tokarev  <annulen@yandex.ru>
2974
2975         Remove excessive include directives from WebCore/css
2976         https://bugs.webkit.org/show_bug.cgi?id=173554
2977
2978         Reviewed by Alex Christensen.
2979
2980         No new tests needed.
2981
2982         * css/CSSComputedStyleDeclaration.h:
2983         * css/CSSContentDistributionValue.h:
2984         * css/CSSCursorImageValue.h:
2985         * css/CSSFilterImageValue.h:
2986         * css/CSSFontFace.h:
2987         * css/CSSFontFeatureValue.h:
2988         * css/CSSFontStyleRangeValue.h:
2989         * css/CSSFontVariationValue.h:
2990         * css/CSSImageGeneratorValue.h:
2991         * css/CSSImageSetValue.h:
2992         * css/CSSInheritedValue.h:
2993         * css/CSSInitialValue.h:
2994         * css/CSSKeyframeRule.cpp:
2995         * css/CSSKeyframeRule.h:
2996         * css/CSSLineBoxContainValue.h:
2997         * css/CSSPrimitiveValue.h:
2998         * css/CSSPrimitiveValueMappings.h:
2999         * css/CSSPropertySourceData.h:
3000         * css/CSSReflectValue.h:
3001         * css/CSSRevertValue.h:
3002         * css/CSSSelector.h:
3003         * css/CSSStyleSheet.h:
3004         * css/CSSToLengthConversionData.h:
3005         * css/CSSUnsetValue.h:
3006         * css/CSSValue.h:
3007         * css/CSSValuePool.h:
3008         * css/CSSVariableData.h:
3009         * css/DeprecatedCSSOMCounter.h:
3010         * css/DeprecatedCSSOMRGBColor.h:
3011         * css/DeprecatedCSSOMRect.h:
3012         * css/DeprecatedCSSOMValue.h:
3013         * css/RuleSet.h:
3014         * css/SelectorChecker.h:
3015         * css/StyleBuilderConverter.h:
3016         * css/StyleBuilderCustom.h:
3017         * css/StyleProperties.h:
3018         * css/StyleResolver.cpp:
3019         * css/StyleResolver.h:
3020         * css/StyleSheet.h:
3021         * css/StyleSheetContents.h:
3022         * css/ViewportStyleResolver.h:
3023         * css/parser/CSSDeferredParser.h:
3024         * css/parser/CSSParserIdioms.h:
3025         * css/parser/CSSParserImpl.cpp:
3026         * css/parser/CSSParserImpl.h:
3027         * css/parser/CSSParserObserver.h:
3028         * css/parser/CSSParserSelector.h:
3029         * css/parser/CSSPropertyParserHelpers.h:
3030         * css/parser/MediaQueryParser.cpp:
3031         * css/parser/MediaQueryParser.h:
3032         * css/parser/SizesAttributeParser.cpp:
3033         * css/parser/SizesAttributeParser.h:
3034         * html/BaseCheckableInputType.cpp:
3035         * html/MediaController.cpp:
3036         * html/track/TextTrack.cpp:
3037         * html/track/TextTrackCue.cpp:
3038         * html/track/VideoTrack.cpp:
3039         * loader/TextTrackLoader.cpp:
3040
3041 2017-06-20  Miguel Gomez  <magomez@igalia.com>
3042
3043         [GTK] Layout Test fast/canvas/webgl/tex-image-and-sub-image-2d-with-video.html makes the subsequent test case flaky crash.
3044         https://bugs.webkit.org/show_bug.cgi?id=173459
3045
3046         Reviewed by Carlos Garcia Campos.
3047
3048         When destructing the VideoTextureCopierGStreamer, ensure that there's a previous gl context before trying
3049         to make it current again. There are situations where no previous context may exist, which can trigger a crash.
3050         Also, add DefaultImageOrientation to the switch that handles the video frame possible orientations, as it's the
3051         value used when no rotation needs to be performed, and it's currently triggering an assertion.
3052
3053         Covered by existent tests.
3054
3055         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
3056         (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
3057         (WebCore::VideoTextureCopierGStreamer::updateTextureSpaceMatrix):
3058
3059 2017-06-19  Devin Rousso  <drousso@apple.com>
3060
3061         Web Inspector: create canvas content view and details sidebar panel
3062         https://bugs.webkit.org/show_bug.cgi?id=138941
3063         <rdar://problem/19051672>
3064
3065         Reviewed by Joseph Pecoraro.
3066
3067         Tests: inspector/canvas/requestContent.html
3068                inspector/canvas/requestNode.html
3069
3070         * inspector/InspectorCanvasAgent.h:
3071         * inspector/InspectorCanvasAgent.cpp:
3072         (WebCore::InspectorCanvasAgent::requestNode):
3073         Gets the node id of the backing canvas element.
3074
3075         (WebCore::InspectorCanvasAgent::requestContent):
3076         Gets the current image content of the canvas.
3077
3078         (WebCore::InspectorCanvasAgent::frameNavigated):
3079         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
3080         Minor fixes from r218376 <https://webkit.org/b/172623>.
3081
3082         (WebCore::InspectorCanvasAgent::buildObjectForCanvas):
3083         Optionally send the `nodeId` of the backing canvas element if it is available.
3084
3085         * inspector/InspectorInstrumentation.cpp:
3086         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
3087
3088 2017-06-19  Frederic Wang  <fwang@igalia.com>
3089
3090         [iOS] Always include frames in the scrolling tree when async frame scrolling is enabled
3091         https://bugs.webkit.org/show_bug.cgi?id=173405
3092
3093         Reviewed by Simon Fraser.
3094
3095         Currently "async frame scrolling" is ignored on iOS. This commit changes that behavior to
3096         align on macOS and is a preliminary step to implement iframe scrolling on iOS (bug 149264).
3097
3098         Test: compositing/iframes/compositing-for-scrollable-iframe.html
3099               fast/scrolling/scrolling-tree-includes-frame.html
3100
3101         * rendering/RenderLayerCompositor.cpp:
3102         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame): Do not require
3103         compositing when "async frame scrolling" is enabled on iOS.
3104
3105 2017-06-19  Frederic Wang  <fwang@igalia.com>
3106
3107         [Mac] Add an experimental feature setting for async frame scrolling
3108         https://bugs.webkit.org/show_bug.cgi?id=173359
3109
3110         Reviewed by Simon Fraser.
3111
3112         The necessary work to use compositing for frames and include them in the scrolling tree on
3113         macOS was performed in r217726 and r217730. ScrollingTreeIncludesFrames was used to
3114         determine when this behavior should be enabled. However, this does not work well on iOS where
3115         ScrollingTreeIncludesFrames defaults to true and really means "include the frames in the
3116         scrolling tree when necessary". Hence we instead introduce a new "async frame scrolling"
3117         switch to enable the behavior on macOS, which will also be used in a follow-up commit on iOS.
3118         This new setting is also made an "experimental feature", so that it will be more convenient
3119         for developer to try it.
3120
3121         Test: compositing/iframes/compositing-for-scrollable-iframe.html
3122               fast/scrolling/scrolling-tree-includes-frame.html
3123
3124         * page/Settings.in: Declare new setting for async frame scrolling.
3125         * page/scrolling/ScrollingCoordinator.cpp:
3126         (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView): Also include frames in
3127         scrolling tree when async frame scrolling is enabled.
3128         * rendering/RenderLayerCompositor.cpp:
3129         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame): Rely on async frame
3130         scrolling to decide when compositing is needed.
3131
3132 2017-06-19  Zalan Bujtas  <zalan@apple.com>
3133
3134         AX: Remove redundant AXObjectCache::textChanged(RenderObject*).
3135         https://bugs.webkit.org/show_bug.cgi?id=173579
3136         <rdar://problem/32865367>
3137
3138         Reviewed by Antti Koivisto.
3139
3140         All calls go through textChanged(Node*) method.
3141
3142         * accessibility/AXObjectCache.cpp:
3143         * accessibility/AXObjectCache.h:
3144         (WebCore::AXObjectCache::getOrCreate):
3145
3146 2017-06-19  Darin Adler  <darin@apple.com>
3147
3148         Merge MediaDevicesRequest and MediaDevicesEnumerationRequest to tighten up code and object lifetime
3149         https://bugs.webkit.org/show_bug.cgi?id=173527
3150
3151         Reviewed by Sam Weinig.
3152
3153         * CMakeLists.txt: Removed MediaDevicesRequest.cpp.
3154
3155         * Modules/mediastream/MediaDeviceInfo.cpp:
3156         (WebCore::MediaDeviceInfo::MediaDeviceInfo): Removed unneeded ScriptExecutionContext.
3157         (WebCore::MediaDeviceInfo::create): Ditto.
3158         * Modules/mediastream/MediaDeviceInfo.h: Removed unnecessary derivation from
3159         ContextDestructionObserver and ScriptExecutionContext arguments. Also removed
3160         unused MediaDeviceInfoVector typedef.
3161         * Modules/mediastream/MediaDeviceInfo.idl: Added ImplementationLacksVTable.
3162
3163         * Modules/mediastream/MediaDevices.cpp:
3164         (WebCore::MediaDevices::enumerateDevices): Call MediaDevicesEnumerationRequest
3165         directly here instead of going through MediaDevicesRequest.
3166
3167         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp: Moved code from
3168         MediaDevicesRequest in here. Put the typical counts at the top of the file.
3169         (WebCore::MediaDevicesEnumerationRequest::MediaDevicesEnumerationRequest):
3170         Marked inline and changed to take a DOM promise directly rather than having
3171         a separate class do the mapping to DOM promises.
3172         (WebCore::MediaDevicesEnumerationRequest::start): Replaced the create function
3173         with this. The caller doesn't actually keep a reference to the object.
3174         Added a FIXME about the behavior, not new, where we neither resolve nor reject
3175         the promise if there is no page object present. Updated to use the new version
3176         of UserMediaController::from.
3177         (WebCore::MediaDevicesEnumerationRequest::~MediaDevicesEnumerationRequest):
3178         Added a FIXME about the issue that we don't resolve or reject the promise if
3179         the client drops the last reference to the request without calling setDeviceInfo.
3180         (WebCore::MediaDevicesEnumerationRequest::document): Added. Private helper.
3181         Returns nullptr if the request is no longer active.
3182         (WebCore::MediaDevicesEnumerationRequest::frame): Added. For use by a caller
3183         that was getting to the frame. Uses the document function so it will return
3184         nullptr if the request is no longer active.
3185         (WebCore::MediaDevicesEnumerationRequest::userMediaDocumentOrigin): Changed
3186         to do the work using the document function.
3187         (WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin): Ditto.
3188         (WebCore::MediaDevicesEnumerationRequest::contextDestroyed): Simplified. We
3189         now can simply set a boolean when the context is destroyed, so there are no
3190         side effects and the code is simpler.
3191         (WebCore::removeAtypicalDevices): Renamed and tightened up the code a bit.
3192         (WebCore::MediaDevicesEnumerationRequest::setDeviceInfo): Moved the code
3193         here from MediaDevicesEnumerationRequest to pass the devices along.
3194
3195         * Modules/mediastream/MediaDevicesEnumerationRequest.h: Made the
3196         ContextDestructionObserver use private inheritance. Cut down the includes
3197         and removed various unneeded functions.
3198
3199         * Modules/mediastream/MediaDevicesRequest.cpp: Removed.
3200         * Modules/mediastream/MediaDevicesRequest.h: Removed.
3201
3202         * Modules/mediastream/UserMediaController.cpp:
3203         (WebCore::UserMediaController::UserMediaController): Use reference rather
3204         than pointer for the client.
3205         (WebCore::UserMediaController::~UserMediaController): Ditto.
3206         (WebCore::provideUserMediaTo): Ditto.
3207
3208         * Modules/mediastream/UserMediaController.h:
3209         Changed constructor to take a refeference, removed client function, and
3210         changed data member to be a reference rather than a pointer.
3211         (WebCore::UserMediaController::from): Take and return a reference rather
3212         than taking a pointer that is checked for null.
3213         (WebCore::UserMediaController::requestUserMediaAccess): Use reference.
3214         (WebCore::UserMediaController::cancelUserMediaAccessRequest): Ditto.
3215         (WebCore::UserMediaController::enumerateMediaDevices): Ditto.
3216         (WebCore::UserMediaController::cancelMediaDevicesEnumerationRequest): Ditto.
3217
3218         * Modules/mediastream/UserMediaRequest.cpp:
3219         (WebCore::UserMediaRequest::start): Updated to use the new version
3220         of UserMediaController::from.
3221
3222         * WebCore.xcodeproj/project.pbxproj: Updated for file removals.
3223
3224         * testing/Internals.cpp: Removed unneeded include of UserMediaController.h.
3225
3226 2017-06-19  Sam Weinig  <sam@webkit.org>
3227
3228         [WebIDL] Move Touch related bindings in Document to their own IDL file
3229         https://bugs.webkit.org/show_bug.cgi?id=173521
3230
3231         Reviewed by Alex Christensen.
3232
3233         Rather than #including in the middle of an IDL file, this moves the touch related
3234         bindings in Document.idl to a new partial interface for Document in DocumentTouch.idl.
3235         While here, remove the custom binding for createTouchList.
3236
3237         * CMakeLists.txt:
3238         * DerivedSources.make:
3239         * WebCore.xcodeproj/project.pbxproj:
3240         Add new files.
3241
3242         * bindings/js/JSDocumentCustom.cpp:
3243         (WebCore::JSDocument::createTouchList): Deleted.
3244         Remove createTouchList. It can be generated now.
3245
3246         * dom/Document.cpp:
3247         (WebCore::Document::createTouch): Deleted.
3248         * dom/Document.h:
3249         Move touch related bindings code to DocumentTouch.h/cpp.
3250         Remove DocumentIOSForward as it is no longer needed.
3251
3252         * dom/Document.idl:
3253         Move touch related bindings to DocumentTouch.idl
3254         
3255         * dom/DocumentTouch.h: Added.
3256         * dom/DocumentTouch.cpp: Added.
3257         (WebCore::DocumentTouch::createTouch):
3258         Moved from Document.
3259
3260         (WebCore::DocumentTouch::createTouchList):
3261         Added to aid generated binding.
3262
3263         * dom/DocumentTouch.idl: Added.
3264         Moved operations from Document.h
3265
3266         * dom/TouchList.h:
3267         (WebCore::TouchList::create):
3268         (WebCore::TouchList::TouchList):
3269         Added create that works with the bindings.
3270
3271         * dom/ios/TouchEvents.cpp:
3272         Add DocumentTouchIOS.h and sort.
3273
3274 2017-06-19  Myles C. Maxfield  <mmaxfield@apple.com>
3275
3276         [Cocoa] The system Japanese font cannot be italicized
3277         https://bugs.webkit.org/show_bug.cgi?id=173300
3278         <rdar://problem/31805407>
3279
3280         Reviewed by Ryosuke Niwa.
3281
3282         Items in the system font cascade list may lie about whether or not they support italics.
3283         In order to get the truth, we need to use the physical font underlying the font in question,
3284         because this one won't lie. Then, we can interrogate this physical font about its traits
3285         in order to synthesize italics correctly.
3286
3287         Test: fast/text/system-font-japanese-synthetic-italic.html
3288
3289         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3290         (WebCore::lookupFallbackFont):
3291         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
3292         (WebCore::FontFamilySpecificationCoreText::fontRanges):
3293
3294 2017-06-19  Daewoong Jang  <daewoong.jang@navercorp.com>
3295
3296         [cURL] Move file scope static variables into function scopes
3297         https://bugs.webkit.org/show_bug.cgi?id=173567
3298
3299         Reviewed by Alex Christensen.
3300
3301         * platform/network/curl/SSLHandle.cpp:
3302         (WebCore::allowedHosts):
3303         (WebCore::allowedClientHosts):
3304         (WebCore::allowsAnyHTTPSCertificateHosts):
3305         (WebCore::addAllowedClientCertificate):
3306         (WebCore::setSSLClientCertificate):
3307         (WebCore::sslIgnoreHTTPSCertificate):
3308         (WebCore::certVerifyCallback):
3309
3310 2017-06-19  Darin Adler  <darin@apple.com>
3311
3312         [Cocoa] implement URLSession:task:needNewBodyStream: delegate method
3313         https://bugs.webkit.org/show_bug.cgi?id=173551
3314         rdar://problem/32250512
3315
3316         Reviewed by Alex Christensen.
3317
3318         Covered by http/tests/misc/form-blob-challenge.html
3319
3320         * WebCore.xcodeproj/project.pbxproj: Removed NSURLRequestSPI.h.
3321
3322         * platform/network/cf/FormDataStreamCFNet.cpp:
3323         (WebCore::createHTTPBodyCFReadStream): Factored this out from setHTTPBody.
3324         (WebCore::setHTTPBody): Factored out the function above.
3325         * platform/network/cf/FormDataStreamCFNet.h: Added createHTTPBodyCFReadStream.
3326
3327         * platform/network/cocoa/ResourceRequestCocoa.mm: Use CFNetworkSPI.h.
3328         * platform/network/ios/ResourceRequestIOS.mm: Ditto.
3329
3330         * platform/network/mac/FormDataStreamMac.h: Added createHTTPBodyNSInputStream.
3331         * platform/network/mac/FormDataStreamMac.mm:
3332         (WebCore::createHTTPBodyNSInputStream): Added/
3333
3334         * platform/network/mac/ResourceHandleMac.mm: Use CFNetworkSPI.h.
3335         * platform/network/mac/ResourceRequestMac.mm: Ditto.
3336         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm: Ditto.
3337         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: Ditto.
3338
3339         * platform/network/mac/WebCoreURLResponse.h: Moved SPI declarations from
3340         here into CFNetworkSPI.h.
3341
3342         * platform/spi/cf/CFNetworkSPI.h: Use #pragma once, consolidated SPI that was
3343         defined in scattered locations.
3344
3345         * platform/spi/cocoa/NSURLRequestSPI.h: Removed. Superceded by CFNetworkSPI.h.
3346
3347 2017-06-19  Brady Eidson  <beidson@apple.com>
3348
3349         Various IndexedDB crashes as an after effect of previous test.
3350         <rdar://problem/31418761> and https://bugs.webkit.org/show_bug.cgi?id=170436
3351
3352         Reviewed by Chris Dumez.
3353
3354         No new test (No consistent test possible, in practice covered by all existing IDB tests)
3355
3356         This is timing related, where a UniqueIDBDatabase can be destroyed on the main thread while
3357         it still has one task left to try to execute on the IDBServer thread.
3358         
3359         The background thread tasks don't Ref<> the UniqueIDBDatabase, so even though task execution
3360         took a Ref<> protector, there was still a small window for a race.
3361         
3362         Should be closed up by making the background thread tasks themselves protect this.
3363         
3364         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3365         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
3366         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
3367         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask):
3368         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTaskReply):
3369         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3370
3371 2017-06-19  Sam Weinig  <sam@webkit.org>
3372
3373         [WebIDL] Add support for serializers that have members that are themselves serializers (or inherit being a serializer from a parent)
3374         https://bugs.webkit.org/show_bug.cgi?id=173395
3375
3376         Reviewed by Simon Fraser.
3377
3378         Test: fast/css/DOMQuad-serialization.html
3379
3380         * bindings/scripts/CodeGenerator.pm:
3381         (InheritsSerializable):
3382         Helper to determine if an interface inherits from any interfaces
3383         that are serializable. This is necessary because an attribute is
3384         serializable even if its interface is not marked as serializable. 
3385
3386         (IsSerializableAttribute):
3387         Check ancestor interfaces as well to determine serializability.
3388
3389         * bindings/scripts/CodeGeneratorJS.pm:
3390         (GenerateSerializerDefinition):
3391         Specialize attributes that are serializable interfaces to call its interfaces
3392         serialize function, thus allowing nested objects to be serialized.
3393
3394         * dom/DOMQuad.idl:
3395         Add serializer.
3396
3397         * bindings/scripts/test/JS/JSTestSerialization.cpp:
3398         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp: Added.
3399         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.h: Added.
3400         * bindings/scripts/test/TestSerialization.idl:
3401         * bindings/scripts/test/TestSerializationIndirectInheritance.idl: Added.
3402         Add and update tests.
3403
3404 2017-06-19  Commit Queue  <commit-queue@webkit.org>
3405
3406         Unreviewed, rolling out r218505.
3407         https://bugs.webkit.org/show_bug.cgi?id=173563
3408
3409         "It would break internal builds" (Requested by youenn on
3410         #webkit).
3411
3412         Reverted changeset:
3413
3414         "[WebRTC] Prevent capturing at unconventional resolutions when
3415         using the SW encoder on Mac"
3416         https://bugs.webkit.org/show_bug.cgi?id=172602
3417         http://trac.webkit.org/changeset/218505
3418
3419 2017-06-19  Zalan Bujtas  <zalan@apple.com>
3420
3421         Opening certain mails brings up a mail that grows indefinitely.
3422         https://bugs.webkit.org/show_bug.cgi?id=173562
3423         <rdar://problem/32766579>
3424
3425         Reviewed by Tim Horton.
3426
3427         This reverts the logic where m_autoSizeContentSize always reflects the final layout's.
3428         When the ICB's height is 100%, it causes infinite recursion.
3429         See also webkit.org/b/173561.
3430
3431         * page/FrameView.cpp:
3432         (WebCore::FrameView::autoSizeIfEnabled):
3433
3434 2017-06-19  Wenson Hsieh  <wenson_hsieh@apple.com>
3435
3436         [iOS DnD] Support .zip archives for file uploads via drag and drop
3437         https://bugs.webkit.org/show_bug.cgi?id=173511
3438         <rdar://problem/32521025>
3439
3440         Reviewed by Tim Horton.
3441
3442         Allows dropped .zip archives to be uploaded as files by accepting types conforming to either
3443         "public.zip-archive" or "public.content" as potential file types. Initially, I opted to accept the more general
3444         "public.data" type; however, this includes UTIs such as "public.url" that should not be represented as files, so
3445         this is a more targeted fix that allows us to very easily add additional content types in the future by adding
3446         more types to supportedFileUploadPasteboardTypes.
3447
3448         Tests:
3449         DataInteractionTests.ExternalSourceZIPArchiveToUploadArea
3450         DataInteractionTests.ExternalSourceZIPArchiveAndURLToSingleFileInput
3451
3452         * page/mac/DragControllerMac.mm:
3453         (WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod):
3454         * platform/Pasteboard.h:
3455         * platform/ios/PasteboardIOS.mm:
3456         (WebCore::Pasteboard::read):
3457         (WebCore::Pasteboard::supportedWebContentPasteboardTypes):
3458         (WebCore::Pasteboard::supportedFileUploadPasteboardTypes):
3459
3460         Rename supportedPasteboardTypes to supportedWebContentPasteboardTypes, and also introduce
3461         supportedFileUploadPasteboardTypes which returns an list of types, such that if a type conforms to any type in
3462         this array, that type may be represented as a file. So far, this list contains "public.content" and
3463         "public.zip-archive".
3464
3465         (WebCore::Pasteboard::types):
3466         (WebCore::Pasteboard::supportedPasteboardTypes): Deleted.
3467         * platform/ios/WebItemProviderPasteboard.mm:
3468         (typeConformsToTypes):
3469
3470         Remove -typeIsAppropriateForSupportedTypes: and replace it with typeConformsToTypes. Use this both when
3471         determining the number of files on the pasteboard, and when determining preferred UTIs to load when dropping.
3472
3473         (-[WebItemProviderPasteboard numberOfFiles]):
3474         (-[WebItemProviderPasteboard typeIdentifierToLoadForRegisteredTypeIdentfiers:]):
3475         (-[WebItemProviderPasteboard typeIsAppropriateForSupportedTypes:]): Deleted.
3476         * platform/mac/DragDataMac.mm:
3477         (WebCore::DragData::containsFiles):
3478         * platform/mac/PasteboardMac.mm:
3479         (WebCore::Pasteboard::supportedFileUploadPasteboardTypes):
3480
3481 2017-06-19  Sam Weinig  <sam@webkit.org>
3482
3483         [WebIDL] Remove custom binding for Document.getCSSCanvasContext()
3484         https://bugs.webkit.org/show_bug.cgi?id=173516
3485
3486         Reviewed by Chris Dumez.
3487
3488         * bindings/js/JSDocumentCustom.cpp:
3489         (WebCore::JSDocument::visitAdditionalChildren):
3490         (WebCore::JSDocument::getCSSCanvasContext): Deleted.
3491         * dom/Document.cpp:
3492         (WebCore::Document::getCSSCanvasContext):
3493         * dom/Document.h:
3494         * dom/Document.idl:
3495         Use a Variant to pass the context and type to the bindings.
3496
3497 2017-06-19  Youenn Fablet  <youenn@apple.com>
3498
3499         [WebRTC] Prevent capturing at unconventional resolutions when using the SW encoder on Mac
3500         https://bugs.webkit.org/show_bug.cgi?id=172602
3501         <rdar://problem/32407693>
3502
3503         Reviewed by Eric Carlson.
3504
3505         Test: platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html
3506
3507         Add internal API to switch on/off hardware H264 encoder.
3508         Add checks for standard size. If using a software encoder and frame size is not standard,
3509         the session is destroyed and no frame is sent at all.
3510
3511         Added tests based on captureStream.
3512         Fixed the case of capturing a canvas which size is changing.
3513
3514         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
3515         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
3516         * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.h:
3517         * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.mm:
3518         (WebCore::H264VideoToolboxEncoder::setHardwareEncoderForWebRTCAllowed):
3519         (WebCore::H264VideoToolboxEncoder::hardwareEncoderForWebRTCAllowed):
3520         (WebCore::isUsingSoftwareEncoder):
3521         (WebCore::H264VideoToolboxEncoder::CreateCompressionSession):
3522         (isStandardFrameSize): Added.
3523         (isUsingSoftwareEncoder): Added.
3524         * testing/Internals.cpp:
3525         (WebCore::Internals::setH264HardwareEncoderAllowed):
3526         * testing/Internals.h:
3527         * testing/Internals.idl:
3528
3529 2017-06-19  Brady Eidson  <beidson@apple.com>
3530
3531         Cleanup IconLoader stuff when a DocumentLoader detaches from its frame.
3532         <rdar://problem/31418761> and https://bugs.webkit.org/show_bug.cgi?id=173473
3533
3534         Reviewed by Alex Christensen.
3535
3536         No new tests (No known change in behavior)
3537
3538         I discovered the need to make these changes here due to a transient bug
3539         introduced in r218015 but already explicitly fixed in r218409.
3540         
3541         This change adds an assert to guard against a detached DocumentLoader having active IconLoaders.
3542
3543         It also clears out all pending IconLoader and icon load decisions when stopLoading() is called, 
3544         as even attempting to start an icon load after detachment is a waste of cycles.
3545         
3546         * loader/DocumentLoader.cpp:
3547         (WebCore::DocumentLoader::stopLoading): Also explicitly clear all IconLoaders and icons pending
3548           load decision.
3549         (WebCore::DocumentLoader::finishedLoadingIcon): Assert that this DocumentLoader is not detached.
3550
3551 2017-06-19  Chris Dumez  <cdumez@apple.com>
3552
3553         Use WTF::Function instead of std::function in more places in WebCore/
3554         https://bugs.webkit.org/show_bug.cgi?id=173535
3555
3556         Reviewed by Antti Koivisto.
3557
3558         Use WTF::Function instead of std::function in more places in WebCore/ to avoid copying.
3559
3560         * accessibility/AccessibilityObject.cpp:
3561         (WebCore::AccessibilityObject::matchedParent):
3562         * accessibility/AccessibilityObject.h:
3563         * animation/DocumentAnimation.cpp:
3564         (WebCore::DocumentAnimation::getAnimations):
3565         * animation/DocumentAnimation.h:
3566         (WebCore::DocumentAnimation::getAnimations):
3567         * contentextensions/CombinedURLFilters.cpp:
3568         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
3569         * contentextensions/CombinedURLFilters.h:
3570         * contentextensions/DFACombiner.cpp:
3571         (WebCore::ContentExtensions::DFACombiner::combineDFAs):
3572         * contentextensions/DFACombiner.h:
3573         * css/CSSCrossfadeValue.cpp:
3574         (WebCore::CSSCrossfadeValue::traverseSubresources):
3575         * css/CSSCrossfadeValue.h:
3576         * css/CSSFilterImageValue.cpp:
3577         (WebCore::CSSFilterImageValue::traverseSubresources):
3578         * css/CSSFilterImageValue.h:
3579         * css/CSSFontFaceSrcValue.cpp:
3580         (WebCore::CSSFontFaceSrcValue::traverseSubresources):
3581         * css/CSSFontFaceSrcValue.h:
3582         * css/CSSImageSetValue.cpp:
3583         (WebCore::CSSImageSetValue::traverseSubresources):
3584         * css/CSSImageSetValue.h:
3585         * css/CSSImageValue.cpp:
3586         (WebCore::CSSImageValue::traverseSubresources):
3587         * css/CSSImageValue.h:
3588         * css/CSSValue.cpp:
3589         (WebCore::CSSValue::traverseSubresources):
3590         * css/CSSValue.h:
3591         * css/CSSValueList.cpp:
3592         (WebCore::CSSValueList::traverseSubresources):
3593         * css/CSSValueList.h:
3594         * css/StyleProperties.cpp:
3595         (WebCore::StyleProperties::traverseSubresources):
3596         * css/StyleProperties.h:
3597         * css/StyleSheetContents.cpp:
3598         (WebCore::traverseSubresourcesInRules):
3599         (WebCore::StyleSheetContents::traverseSubresources):
3600         * css/StyleSheetContents.h:
3601         * dom/Element.cpp:
3602         (WebCore::Element::getAnimations):
3603         * editing/TextIterator.cpp:
3604         (WebCore::findPlainTextMatches):
3605         (WebCore::findClosestPlainText):
3606         (WebCore::findPlainText):
3607         * editing/mac/DictionaryLookup.h:
3608         * editing/mac/DictionaryLookup.mm:
3609         (WebCore::showPopupOrCreateAnimationController):
3610         (WebCore::DictionaryLookup::showPopup):
3611         (WebCore::DictionaryLookup::animationControllerForPopup):
3612         * fileapi/AsyncFileStream.cpp:
3613         (WebCore::AsyncFileStream::perform):
3614         (WebCore::AsyncFileStream::getSize):
3615         (WebCore::AsyncFileStream::openForRead):
3616         (WebCore::AsyncFileStream::read):
3617         * fileapi/AsyncFileStream.h:
3618         * html/HTMLMediaElement.cpp:
3619         (WebCore::HTMLMediaElement::waitForPreparedForInlineThen):
3620         (WebCore::HTMLMediaElement::setVideoFullscreenLayer):
3621         * html/HTMLMediaElement.h:
3622         (WebCore::HTMLMediaElement::waitForPreparedForInlineThen):
3623         (WebCore::HTMLMediaElement::setVideoFullscreenLayer):
3624         * loader/EmptyClients.cpp:
3625         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
3626         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3627         (WebCore::EmptyFrameLoaderClient::dispatchWillSubmitForm):
3628         * loader/FrameLoaderClient.h:
3629         * loader/archive/cf/LegacyWebArchive.cpp:
3630         (WebCore::LegacyWebArchive::create):
3631         * loader/archive/cf/LegacyWebArchive.h:
3632         * loader/cache/MemoryCache.cpp:
3633         (WebCore::MemoryCache::forEachResource):
3634         (WebCore::MemoryCache::forEachSessionResource):
3635         * loader/cache/MemoryCache.h:
3636         * page/DOMWindow.cpp:
3637         (WebCore::DOMWindow::createWindow):
3638         (WebCore::DOMWindow::showModalDialog):
3639         * page/DOMWindow.h:
3640         * page/FrameView.cpp:
3641         (WebCore::FrameView::applyRecursivelyWithVisibleRect):
3642         * page/FrameView.h:
3643         * page/Page.cpp:
3644         (WebCore::Page::forEachPage):
3645         (WebCore::Page::decrementNestedRunLoopCount):
3646         (WebCore::Page::whenUnnested):
3647         * page/Page.h:
3648         * page/WheelEventTestTrigger.cpp:
3649         (WebCore::WheelEventTestTrigger::clearAllTestDeferrals):
3650         (WebCore::WheelEventTestTrigger::setTestCallbackAndStartNotificationTimer):
3651         (WebCore::WheelEventTestTrigger::triggerTestTimerFired):
3652         * page/WheelEventTestTrigger.h:
3653         * page/WindowFeatures.cpp:
3654         (WebCore::processFeaturesString):
3655         * page/WindowFeatures.h:
3656         * page/cocoa/ResourceUsageOverlayCocoa.mm:
3657         (WebCore::RingBuffer::forEach):
3658         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
3659         (WebCore::WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer):
3660         (WebCore::WebVideoFullscreenModelVideoElement::waitForPreparedForInlineThen):
3661         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
3662         (WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer):
3663         (WebVideoFullscreenModelVideoElement::waitForPreparedForInlineThen):
3664         * platform/graphics/MediaPlayer.cpp:
3665         (WebCore::MediaPlayer::setVideoFullscreenLayer):
3666         * platform/graphics/MediaPlayer.h:
3667         (WebCore::MediaPlayer::setVideoFullscreenLayer):
3668         * platform/graphics/MediaPlayerPrivate.h:
3669         (WebCore::MediaPlayerPrivateInterface::setVideoFullscreenLayer):
3670         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3671         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3672         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
3673         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3674         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3675         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer):
3676         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
3677         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3678         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer):
3679         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h:
3680         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
3681         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer):
3682
3683 2017-06-19  Chris Dumez  <cdumez@apple.com>
3684
3685         Use WTF::Function instead of std::function in WebCore/Modules
3686         https://bugs.webkit.org/show_bug.cgi?id=173534
3687
3688         Reviewed by Alex Christensen.
3689
3690         Use WTF::Function instead of std::function in WebCore/Modules to avoid
3691         copying.
3692
3693         * Modules/applepay/PaymentCoordinatorClient.h:
3694         * Modules/encryptedmedia/CDM.h:
3695         * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
3696         (WebCore::CDMFactory::CDMFactory):
3697         (WebCore::CDM::registerCDMFactory):
3698         * Modules/encryptedmedia/legacy/LegacyCDM.h:
3699         * Modules/mediasession/MediaSession.cpp:
3700         (WebCore::MediaSession::changeActiveMediaElements):
3701         (WebCore::MediaSession::safelyIterateActiveMediaElements):
3702         * Modules/mediasession/MediaSession.h:
3703         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
3704         (WebCore::matchTransceiver):
3705         * Modules/mediastream/MediaStreamRegistry.cpp:
3706         (WebCore::MediaStreamRegistry::forEach):
3707         * Modules/mediastream/MediaStreamRegistry.h:
3708
3709 2017-06-19  Youenn Fablet  <youenn@apple.com>
3710
3711         A cloned MediaStreamTrack should mute independently other tracks using the same source
3712         https://bugs.webkit.org/show_bug.cgi?id=172831
3713         <rdar://problem/32518527>
3714
3715         Reviewed by Eric Carlson.
3716
3717         Test: webrtc/clone-audio-track.html
3718
3719         Move enabled handling in MediaStreamTrackPrivate instead of RealtimeMediaSource.
3720         Move WebRTC and WebAudio customers of RealtimeMediaSource to MediaStreamTrackPrivate.
3721         Move creation of WebAudio provider to MediaStreamTrackPrivate.
3722
3723         This allows changing some parameters of tracks having the same source independently.
3724         Using this for enabled track attribute.
3725
3726         We no longer stop generating frames in case track is disabled.
3727         This should be added back as an optimization in a follow-up.
3728
3729         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3730         (WebCore::LibWebRTCMediaEndpoint::addTrack):
3731         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3732         (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack):
3733         * Modules/webaudio/MediaStreamAudioSource.cpp:
3734         * Modules/webaudio/MediaStreamAudioSource.h:
3735         * WebCore.xcodeproj/project.pbxproj:
3736         * platform/mediastream/MediaStreamTrackPrivate.cpp:
3737         (WebCore::MediaStreamTrackPrivate::create):
3738         (WebCore::MediaStreamTrackPrivate::~MediaStreamTrackPrivate):
3739         (WebCore::MediaStreamTrackPrivate::setEnabled):
3740         (WebCore::MediaStreamTrackPrivate::audioSourceProvider):
3741         (WebCore::MediaStreamTrackPrivate::videoSampleAvailable):
3742         (WebCore::MediaStreamTrackPrivate::audioSamplesAvailable):
3743         * platform/mediastream/MediaStreamTrackPrivate.h:
3744         (WebCore::MediaStreamTrackPrivate::Observer::audioSamplesAvailable):
3745         * platform/mediastream/RealtimeMediaSource.cpp:
3746         (WebCore::RealtimeMediaSource::removeObserver):
3747         * platform/mediastream/RealtimeMediaSource.h:
3748         * platform/mediastream/mac/AVMediaCaptureSource.h:
3749         * platform/mediastream/mac/AVMediaCaptureSource.mm:
3750         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3751         (WebCore::CoreAudioCaptureSource::startProducingData):
3752         (WebCore::CoreAudioCaptureSource::stopProducingData):
3753         * platform/mediastream/mac/CoreAudioCaptureSource.h:
3754         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
3755         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
3756         (WebCore::MockRealtimeAudioSourceMac::render):
3757         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
3758         (WebCore::RealtimeIncomingAudioSource::~RealtimeIncomingAudioSource):
3759         (WebCore::RealtimeIncomingAudioSource::OnData):
3760         * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
3761         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
3762         (WebCore::RealtimeIncomingVideoSource::pixelBufferFromVideoFrame):
3763         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
3764         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
3765         (WebCore::RealtimeOutgoingAudioSource::setSource):
3766         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
3767         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
3768         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
3769         (WebCore::RealtimeOutgoingVideoSource::setSource):
3770         (WebCore::RealtimeOutgoingVideoSource::initializeFromSource):
3771         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
3772         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
3773         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
3774         (WebCore::WebAudioSourceProviderAVFObjC::create):
3775         (WebCore::WebAudioSourceProviderAVFObjC::WebAudioSourceProviderAVFObjC):
3776         (WebCore::WebAudioSourceProviderAVFObjC::setClient):
3777         (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
3778         * platform/mock/MockRealtimeVideoSource.cpp:
3779         (WebCore::MockRealtimeVideoSource::generateFrame):
3780         * platform/spi/cocoa/PassKitSPI.h:
3781
3782 2017-06-19  Sam Weinig  <sam@webkit.org>
3783
3784         [WebIDL] Properly model buffer source / typed arrays as their own IDL types
3785         https://bugs.webkit.org/show_bug.cgi?id=173513
3786
3787         Reviewed by Alex Christensen.
3788
3789         - Adds IDL type hierarchy for buffer source types.
3790         - Includes a special type, IDLArrayBufferView, which WebIDL defines as the union
3791           of DataView and all the typed array types, but we model as shared base class.
3792           This should not be observable, and allows us to avoid using a Variant for ArrayBufferView
3793           and instead use the existing base class.
3794         - Add builtin typedefs for BufferSource and DOMTimeStamp as defined in WebIDL. As noted
3795           above, rather than define a typedef of ArrayBufferView that maps to a union, we treat
3796           it as a special type.
3797
3798         * bindings/IDLTypes.h:
3799         Add type hierarchy for buffer source types.
3800         - IDLBufferSource is the root
3801         - IDLArrayBuffer, IDLArrayBufferView, IDLDataView, IDLTypedArray derive from it.
3802         - And then the specific typed array types derive from IDLTypedArray, and are defined
3803           in JSDOMConvertBufferSource so we don't have to include a ton of typed array includes
3804           in this file, as they cannot be forward declared.
3805
3806         * bindings/js/JSDOMConvertBufferSource.h:
3807         (WebCore::Detail::BufferSourceConverter::convert):
3808         (WebCore::Converter<IDLArrayBuffer>::convert):
3809         (WebCore::JSConverter<IDLArrayBuffer>::convert):
3810         (WebCore::Converter<IDLDataView>::convert):
3811         (WebCore::JSConverter<IDLDataView>::convert):
3812         (WebCore::Converter<IDLInt8Array>::convert):
3813         (WebCore::JSConverter<IDLInt8Array>::convert):
3814         (WebCore::Converter<IDLInt16Array>::convert):
3815         (WebCore::JSConverter<IDLInt16Array>::convert):
3816         (WebCore::Converter<IDLInt32Array>::convert):
3817         (WebCore::JSConverter<IDLInt32Array>::convert):
3818         (WebCore::Converter<IDLUint8Array>::convert):
3819         (WebCore::JSConverter<IDLUint8Array>::convert):
3820         (WebCore::Converter<IDLUint16Array>::convert):
3821         (WebCore::JSConverter<IDLUint16Array>::convert):
3822         (WebCore::Converter<IDLUint32Array>::convert):
3823         (WebCore::JSConverter<IDLUint32Array>::convert):
3824         (WebCore::Converter<IDLUint8ClampedArray>::convert):
3825         (WebCore::JSConverter<IDLUint8ClampedArray>::convert):
3826         (WebCore::Converter<IDLFloat32Array>::convert):
3827         (WebCore::JSConverter<IDLFloat32Array>::convert):
3828         (WebCore::Converter<IDLFloat64Array>::convert):
3829         (WebCore::JSConverter<IDLFloat64Array>::convert):
3830         (WebCore::Converter<IDLArrayBufferView>::convert):
3831         (WebCore::JSConverter<IDLArrayBufferView>::convert):
3832         Add native and javascript conversion for all the new types.
3833
3834         * bindings/js/JSDOMConvertUnion.h:
3835         Add support for steps 7, 8, and 9 of the union conversion algorithm now that
3836         buffer source types are properly modeled.
3837
3838         * bindings/js/JSSubtleCryptoCustom.cpp:
3839         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
3840         Replace use of now repurposed IDLBufferSource, with its definition, IDLUnion<IDLArrayBufferView, IDLArrayBuffer>.
3841
3842         * bindings/scripts/CodeGenerator.pm:
3843         (IsBufferSourceType):
3844         Renamed from IsTypedArrayType.
3845
3846         (IsNonPointerType): Deleted.
3847         Was only used by DumpRenderTree and WebKitTestRunner generators. They have 
3848         been switched to the equivalent IsPrimitiveType.
3849
3850         (IsTypedArrayType): Deleted.
3851         Renamed to IsBufferSourceType.
3852
3853         (IsRefPtrType): Deleted. Unused.
3854
3855         * bindings/scripts/CodeGeneratorJS.pm:
3856         (AddToIncludesForIDLType):
3857         (AddClassForwardIfNeeded):
3858         (GetArgumentExceptionFunction):
3859         (GetAttributeExceptionFunction):
3860         (PassArgumentExpression):
3861         (GenerateDefaultValue):
3862         (GenerateOverloadDispatcher):
3863         (ShouldPassArgumentByReference):
3864         (NativeToJSValueDOMConvertNeedsState):
3865         (NativeToJSValueDOMConvertNeedsGlobalObject):
3866         Update for rename of IsTypedArrayType -> IsBufferSourceType and remove specialized BufferSource
3867         condition.
3868
3869         (GetBaseIDLType):
3870         Add mappings for new buffer source types.
3871
3872         * bindings/scripts/IDLParser.pm:
3873         (Parse):
3874         Insert builtin typedefs to the typedef map before parsing.
3875
3876         (addBuiltinTypedefs):
3877         Generate typedefs for BufferSource and DOMTimeStamp as specified by WebIDL.
3878
3879         (applyTypedefs):
3880         Add support for applying typedefs to iterable and maplike, necessary now because BufferSource
3881         is used as the key to iterable in MediaKeyStatusMap.idl
3882
3883         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
3884         * bindings/scripts/test/JS/JSTestCallbackInterface.h:
3885         * bindings/scripts/test/JS/JSTestObj.cpp:
3886         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3887         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3888         * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
3889         * bindings/scripts/test/JS/JSTestVoidCallbackFunction.h:
3890         Update test results.
3891
3892         * bindings/scripts/test/TestTypedefs.idl:
3893         Add tests for builtin typedefs.
3894
3895         * Modules/geolocation/Geoposition.idl:
3896         * dom/Event.idl:
3897         * fileapi/Blob.idl:
3898         * fileapi/File.idl:
3899         * page/FrameView.h:
3900         * xml/XMLHttpRequest.idl:
3901         Remove typedef for DOMTimeStamp and BufferSource which are now automatically included.
3902
3903 2017-06-19  Adrian Perez de Castro  <aperez@igalia.com>
3904
3905         Missing <functional> includes make builds fail with GCC 7.x
3906         https://bugs.webkit.org/show_bug.cgi?id=173544
3907
3908         Unreviewed gardening.
3909
3910         Fix compilation with GCC 7.
3911
3912         * Modules/mediastream/MediaStreamRegistry.h:
3913         * animation/DocumentAnimation.h:
3914         * page/WheelEventTestTrigger.h:
3915         * page/csp/ContentSecurityPolicy.h:
3916         * platform/Timer.h:
3917         * platform/graphics/gstreamer/MainThreadNotifier.h:
3918         * platform/network/NetworkStorageSession.h:
3919
3920 2017-06-19  Zan Dobersek  <zdobersek@igalia.com>
3921
3922         Unreviewed build fix after r218484.
3923
3924         Properly access the GCryptCipherOperation type (now CipherOperation)
3925         in the PAL::GCrypt namespace. This somehow worked in local builds.
3926
3927         * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
3928         (WebCore::callOperation):
3929         (WebCore::gcryptAES_CTR):
3930
3931 2017-06-19  Zan Dobersek  <zdobersek@igalia.com>
3932
3933         [GCrypt] AES_CTR support
3934         https://bugs.webkit.org/show_bug.cgi?id=171420
3935
3936         Reviewed by Michael Catanzaro.
3937
3938         Implement AES_CTR support for build configurations that use libgcrypt.
3939
3940         Both encryption and decryption operations are handled in a single gcryptAES_CTR() function,
3941         with the specific operation being passed as the first argument. The appropriate AES
3942         algorithm is picked, and a gcry_cipher_hd_t object is created and has the given key set.
3943         This key will remain the same throughout the gcry_cipher_hd_t lifetime, even after
3944         gcry_cipher_reset() calls.
3945
3946         The encrypt/decrypt operation is wrapped into a helper lambda functor that accepts the
3947         given counter and input data. It resets the cipher object, sets the counter data, and
3948         performs the specified operation, returning the output data.
3949
3950         libgcrypt doesn't support setting counter data on a gcry_cipher_hd_t object with only
3951         part of that data being used as the actual counter, with the rest acting as a nonce, like
3952         the Web Crypto specification allows. We have to implement the support for that on our own.
3953
3954         We compute the number of blocks we'll be processing and the upper exclusive limit for the
3955         given counter length. We immediately bail if the counter limit is less than the computed
3956         block count, since that would mean that the counter values would be repeated.
3957
3958         We short-cut to a direct operation call if the counter length matches size of the counter
3959         data -- we don't have to adjust the counter data in any way if that's the case.
3960
3961         Otherwise we move counter data into the MPI format. The nonce and the actual counter MPIs
3962         can split out of the counter data MPI with the modulus operation and the counter limit MPI.
3963
3964         We take another shortcut straight to the operation call if we're able to determine that the
3965         'counter leeway' value, i.e. the difference between the initial counter MPI and the counter
3966         limit MPI, is larger or equal to the predicted block size -- if that's the case, the counter
3967         won't wrap around and change the nonce data.
3968
3969         In worst-case scenario the counter data will wrap around and we have to address that. The
3970         current implementation takes the slowest possible path for the moment, encrypting/decrypting
3971         each block separately. For each step the counter is combined with the nonce, the resulting
3972         MPI data retrieved and passed to the operation function, and the returned block output
3973         appended to the final output vector. The counter MPI is then incremented and ran through the
3974         modulus operation, limiting the MPI value to the previously-computed counter limit.
3975
3976         No new tests -- relevant tests are passing and are unskipped.
3977
3978         * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
3979         (WebCore::callOperation):
3980         (WebCore::gcryptAES_CTR):
3981         (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
3982         (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
3983
3984 2017-05-14 Frederic Wang  <fwang@igalia.com>
3985
3986         Add heuristic to avoid flattening "fullscreen" iframes
3987         https://bugs.webkit.org/show_bug.cgi?id=171914
3988
3989         Reviewed by Simon Fraser.
3990
3991         Some authors implement fullscreen popups as out-of-flow iframes with size set to full viewport (using vw/vh CSS units).
3992         When iframe flattening is enabled, such iframes may unexpectedly become larger than the viewport.
3993         This commit adds a simple heuristic to avoid frame flattening in that case.
3994         It is experimented by introducing a "enable for non-fullscreen iframes" state for the frame
3995         flattening setting.
3996         The default frame flattening is still either disabled or (fully) enabled on all platforms.
3997         InternalSettings is also adjusted so that the tests can still set the frame flattening setting.
3998
3999         Test: fast/frames/flattening/iframe-flattening-fullscreen.html
4000
4001         * page/FrameView.cpp:
4002         (WebCore::FrameView::frameFlatteningEnabled): Use the frame flattening enum setting.
4003         * page/Settings.h: Define a frame flattening enum that includes a "enable for non-fullscreen
4004         iframes" state.
4005         * page/Settings.in: Redefine frame flattening using that enum.
4006         * rendering/RenderFrameSet.cpp:
4007         (WebCore::RenderFrameSet::flattenFrameSet): Use the frame flattening enum setting.
4008         * rendering/RenderIFrame.cpp:
4009         (WebCore::RenderIFrame::isFullScreenIFrame): Add a heuristic when partial frame flattening
4010         is enabled setting is enabled.
4011         There is not a strict comparison against the viewport size since authors may not exactly use
4012         100vw/100vh.
4013         Anyway, it is hard to do such comparison using the resolved width & height on RenderStyle.
4014         (WebCore::RenderIFrame::flattenFrame): Add a comment for the existing "zero size" heuristic.
4015         Use isFullScreenIFrame heuristic.
4016         * rendering/RenderView.cpp:
4017         (WebCore::FrameFlatteningLayoutDisallower::FrameFlatteningLayoutDisallower): Use the frame flattening enum setting.
4018         * testing/InternalSettings.cpp:
4019         (WebCore::InternalSettings::Backup::Backup): Add backup for frame flattening.
4020         (WebCore::InternalSettings::Backup::restoreTo): Ditto.
4021         (WebCore::internalSettingsToWebCoreValue): Helper function to cast the frame flattening values.
4022         (WebCore::InternalSettings::setFrameFlattening): Redefine setFrameFlattening to accept an enum.
4023         * testing/InternalSettings.h: Define new enum & setter for frame flattening as well as a backup value.
4024         * testing/InternalSettings.idl: Define new enum & setter for frame flattening.
4025
4026 2017-06-18  Carlos Garcia Campos  <cgarcia@igalia.com>
4027
4028         REGRESSION(r218253): Infinite animated gifs no longer loop
4029         https://bugs.webkit.org/show_bug.cgi?id=173464
4030