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