[iOS] Video occasionally mixes with other system audio instead of interrupting
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-06-09  Jer Noble  <jer.noble@apple.com>
2
3         [iOS] Video occasionally mixes with other system audio instead of interrupting
4         https://bugs.webkit.org/show_bug.cgi?id=173127
5
6         Reviewed by Eric Carlson.
7
8         Tests: platform/mac/audio-session-category-video-track-change.html
9
10         When an HTMLMediaElement's tracks change their enabled state, make sure to update
11         the PlatformMediaElement, for canProduceAudio() may have changed. 
12
13         * html/HTMLMediaElement.cpp:
14         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
15         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
16         (PlatformMediaSessionManager::updateSessionState):
17
18         The rest of the changes in this revision are to allow the above to be testable.
19
20         * page/Settings.cpp:
21         * page/Settings.h:
22         * platform/audio/AudioSession.h:
23         * platform/audio/mac/AudioSessionMac.cpp:
24         (WebCore::AudioSession::category):
25         (WebCore::AudioSession::setCategory):
26         * testing/InternalSettings.cpp:
27         (WebCore::InternalSettings::Backup::Backup):
28         (WebCore::InternalSettings::Backup::restoreTo):
29         (WebCore::InternalSettings::setShouldManageAudioSessionCategory):
30         * testing/InternalSettings.h:
31         * testing/InternalSettings.idl:
32         * testing/Internals.cpp:
33         (WebCore::Internals::audioSessionCategory):
34         * testing/Internals.h:
35         * testing/Internals.idl:
36
37 2017-06-09  Chris Dumez  <cdumez@apple.com>
38
39         CSS transitions added while page is not visible do not start when the page becomes visible
40         https://bugs.webkit.org/show_bug.cgi?id=173166
41         <rdar://problem/32250351>
42
43         Reviewed by Darin Adler.
44
45         CSS transitions added while page is not visible would not start when the page becomes
46         visible. The issue was that when CompositeAnimation::updateTransitions() was called
47         while the page is hidden (and animations are therefore suspended), it would not
48         populate m_transations with ImplicitAnimation objects. We would therefore have later
49         no transitions to resume when the page becomes visible later on. This patch updates
50         CompositeAnimation::updateTransitions() to properly populate m_transitions and instead
51         pause the ImplicitAnimation it creates if animations are currently suspended. This
52         behavior is more consistent with the one of CompositeAnimation::updateKeyframeAnimations().
53
54         I also needed to update ImplicitAnimation::animate() to not restart a paused animation
55         if the animation is currently paused. This is similar to what is done in
56         KeyframeAnimation::animate(). Without this, the paused ImplicitAnimation we add to
57         m_transition would incorrectly get unpaused while the page is still hidden and the
58         animations are still supposed to be suspended. This issue was showing when running the
59         test I am adding in this patch.
60
61         Test: fast/animation/css-animation-resuming-when-visible.html
62
63         * page/animation/CompositeAnimation.cpp:
64         (WebCore::CompositeAnimation::updateTransitions):
65         * page/animation/ImplicitAnimation.cpp:
66         (WebCore::ImplicitAnimation::animate):
67         (WebCore::ImplicitAnimation::reset):
68         * page/animation/ImplicitAnimation.h:
69
70 2017-06-09  Yusuke Suzuki  <utatane.tea@gmail.com>
71
72         Unreviewed, Use FALLTHROUGH
73
74         * loader/LinkLoader.cpp:
75         (WebCore::createLinkPreloadResourceClient):
76
77 2017-06-09  Eric Carlson  <eric.carlson@apple.com>
78
79         fast/mediastream/MediaStream-page-muted.html times out and asserts
80         https://bugs.webkit.org/show_bug.cgi?id=170355
81         <rdar://problem/31376041>
82
83         MediaStream and MediaStreamTrack need to prevent JS wrapper collection while it is possible
84         to fire an event or event listeners won't be notified.
85
86         Reviewed by Chris Dumez.
87
88         Test: fast/mediastream/media-stream-wrapper-collected.html
89
90         * Modules/mediastream/MediaStream.cpp:
91         (WebCore::MediaStream::MediaStream): Initialize ActiveDOMObject.
92         (WebCore::MediaStream::stop): New.
93         (WebCore::MediaStream::activeDOMObjectName): Ditto.
94         (WebCore::MediaStream::canSuspendForDocumentSuspension): Ditto.
95         (WebCore::MediaStream::hasPendingActivity): Ditto, prevent collection if there
96         are registered event listeners.
97         (WebCore::MediaStream::contextDestroyed): Deleted.
98         * Modules/mediastream/MediaStream.h:
99         * Modules/mediastream/MediaStream.idl:
100
101         * Modules/mediastream/MediaStreamTrack.cpp:
102         (WebCore::MediaStreamTrack::hasPendingActivity): Prevent collection if there
103         are registered event listeners.
104         * Modules/mediastream/MediaStreamTrack.h:
105
106         * testing/Internals.cpp:
107         (WebCore::Internals::removeMediaStreamTrack): stream.removeTrack doesn't generate a 'removetrack'
108         event, so call private method that does.
109         * testing/Internals.h:
110         * testing/Internals.idl:
111
112 2017-06-09  Daewoong Jang  <daewoong.jang@navercorp.com>
113
114         [cURL] Remove a call to Windows API
115         https://bugs.webkit.org/show_bug.cgi?id=172079
116
117         Reviewed by Yusuke Suzuki.
118
119         * platform/network/curl/CurlDownload.cpp:
120         (WebCore::CurlDownload::moveFileToDestination):
121         * platform/win/FileSystemWin.cpp:
122         (WebCore::moveFile):
123
124 2017-06-09  Miguel Gomez  <magomez@igalia.com>
125
126         [GTK][WPE] Fix alpha premultiplying when using cairo to draw the video frames
127         https://bugs.webkit.org/show_bug.cgi?id=173097
128
129         Reviewed by Carlos Garcia Campos.
130
131         We need to premultiply alpha when creating a cairo surface from a GStreamer video frame, if the frame
132         has an alpha component. Currently this is wrongly done in VideoSinkGStreamer, as it assumes that every
133         frame is going to be rendered with cairo, which is not the case when using accelerated compositing.
134         The premultiply must happen inside ImageGStreamerCairo, which is where we know that the frame is
135         going to be rendered with cairo, and where the premultiply can be performed when gstreamer-gl is
136         enabled as well.
137
138         Covered by existent tests.
139
140         * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
141         (ImageGStreamer::ImageGStreamer):
142         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
143         (webkitVideoSinkRequestRender):
144
145 2017-06-09  Zan Dobersek  <zdobersek@igalia.com>
146
147         [WPE] Enable ENCRYPTED_MEDIA for build-webkit builds
148         https://bugs.webkit.org/show_bug.cgi?id=173103
149
150         Reviewed by Xabier Rodriguez-Calvar.
151
152         * Modules/encryptedmedia/CDM.cpp:
153         (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
154         Pass the ParsedContentType's mime type string to the explicit ContentType
155         constructor and assign that to the MediaEngineSupportParameters' type
156         member.
157
158 2017-06-08  Ryosuke Niwa  <rniwa@webkit.org>
159
160         Move TreeScope::adoptIfNeeded to Node and rename it to setTreeScopeRecursively
161         https://bugs.webkit.org/show_bug.cgi?id=173129
162
163         Reviewed by Antti Koivisto.
164
165         Renamed TreeScope::adoptIfNeeded to setTreeScopeRecursively and moved to Node.
166
167         The old name was really confusing because due to the existence of Document::adoptNode, a DOM API,
168         which removes the adopted node from its parent if there was one before adopting the node.
169         Most confusingly, this function called TreeScope::adoptIfNeeded.
170
171         Also inlined the tree scope check to avoid calling to moveTreeToNewScope when there is nothing to do.
172
173         This patch effectively reverts r104528.
174
175         No new tests. Existing tests cover this.
176
177         * dom/Attr.cpp:
178         (WebCore::Attr::detachFromElementWithValue):
179         (WebCore::Attr::attachToElement):
180         * dom/ContainerNode.cpp:
181         (WebCore::ContainerNode::takeAllChildrenFrom):
182         (WebCore::ContainerNode::insertBefore):
183         (WebCore::ContainerNode::replaceChild):
184         (WebCore::ContainerNode::removeBetween):
185         (WebCore::ContainerNode::replaceAllChildren):
186         (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck):
187         (WebCore::ContainerNode::parserAppendChild):
188         * dom/ContainerNodeAlgorithms.cpp:
189         (WebCore::addChildNodesToDeletionQueue):
190         * dom/Document.cpp:
191         (WebCore::Document::adoptNode):
192         * dom/Element.cpp:
193         (WebCore::Element::ensureAttr):
194         * dom/Node.cpp:
195         (WebCore::DidMoveToNewDocumentAssertionScope): Added. The old assertion wasn't sufficient when
196         HTMLTemplateElement made a recursive call to setTreeScopeRecursively.
197         (WebCore::DidMoveToNewDocumentAssertionScope::DidMoveToNewDocumentAssertionScope):
198         (WebCore::DidMoveToNewDocumentAssertionScope::~DidMoveToNewDocumentAssertionScope):
199         (WebCore::DidMoveToNewDocumentAssertionScope::didRecieveCall):
200         (WebCore::moveNodeToNewDocument): Moved from TreeScope. Calls to incrementReferencingNodeCount
201         and decrementReferencingNodeCount to Node::didMoveToNewDocument. This function is now eliminated
202         in a release build.
203         (WebCore::moveShadowTreeToNewDocument): Moved from TreeScope.
204         (WebCore::Node::moveTreeToNewScope): Ditto.
205         (WebCore::Node::didMoveToNewDocument): See the description for moveNodeToNewDocument above.
206         * dom/Node.h:
207         (WebCore::Node::isParsingChildrenFinished): Moved to avoid having its own protected section.
208         (WebCore::Node::setIsParsingChildrenFinished): Ditto.
209         (WebCore::Node::clearIsParsingChildrenFinished): Ditto.
210         (WebCore::Node::setTreeScopeRecursively): Moved from TreeScope::adoptIfNeeded.
211         * dom/ShadowRoot.cpp:
212         (WebCore::ShadowRoot::~ShadowRoot):
213         * dom/TreeScope.cpp:
214         (WebCore::TreeScope::adoptIfNeeded): Deleted.
215         (WebCore::TreeScope::moveTreeToNewScope): Deleted.
216         (WebCore::TreeScope::ensureDidMoveToNewDocumentWasCalled): Deleted.
217         (WebCore::TreeScope::moveNodeToNewDocument): Deleted.
218         (WebCore::TreeScope::moveShadowTreeToNewDocument): Deleted.
219         * dom/TreeScope.h:
220         * html/HTMLTemplateElement.cpp:
221         (WebCore::HTMLTemplateElement::didMoveToNewDocument):
222
223 2017-06-09  Adrien Plazas  <aplazas@igalia.com>
224
225         [GTK] Add kinetic scrolling
226         https://bugs.webkit.org/show_bug.cgi?id=155750
227
228         Reviewed by Carlos Garcia Campos.
229
230         Patch by Adrien Plazas and Yusuke Suzuki.
231
232         Add the ScrollAnimationKinetic scrolling animation allowing to perform momentum scrolling; it is based on GTK+'s
233         GtkKineticScrolling type.
234
235         Add the notion of phase, momentum phase and swipe velocity to PlatformWheelEvent.
236
237         Depending on whether the scrolling ended normally or triggered a swipe, the scroll animator will either compute
238         the swipe velocity from the previous scrolling events or use the one from the swipe gesture to initiate the
239         momentum scrolling.
240
241         * PlatformGTK.cmake:
242         * platform/PlatformWheelEvent.h:
243         (WebCore::PlatformWheelEvent::setHasPreciseScrollingDeltas):
244         (WebCore::PlatformWheelEvent::phase):
245         (WebCore::PlatformWheelEvent::momentumPhase):
246         (WebCore::PlatformWheelEvent::isTransitioningToMomentumScroll):
247         * platform/ScrollAnimation.h:
248         (WebCore::ScrollAnimation::scroll):
249         (WebCore::ScrollAnimation::updateVisibleLengths):
250         (WebCore::ScrollAnimation::setCurrentPosition):
251         * platform/ScrollAnimationKinetic.cpp: Added.
252         (WebCore::ScrollAnimationKinetic::PerAxisData::PerAxisData):
253         (WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll):
254         (WebCore::ScrollAnimationKinetic::ScrollAnimationKinetic):
255         (WebCore::ScrollAnimationKinetic::~ScrollAnimationKinetic):
256         (WebCore::ScrollAnimationKinetic::stop):
257         (WebCore::ScrollAnimationKinetic::start):
258         (WebCore::ScrollAnimationKinetic::animationTimerFired):
259         * platform/ScrollAnimationKinetic.h: Copied from Source/WebCore/platform/ScrollAnimation.h.
260         * platform/gtk/PlatformWheelEventGtk.cpp:
261         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
262         (WebCore::PlatformWheelEvent::swipeVelocity):
263         * platform/gtk/ScrollAnimatorGtk.cpp:
264         (WebCore::ScrollAnimatorGtk::ScrollAnimatorGtk):
265         (WebCore::ScrollAnimatorGtk::ensureSmoothScrollingAnimation):
266         (WebCore::ScrollAnimatorGtk::scroll):
267         (WebCore::ScrollAnimatorGtk::scrollToOffsetWithoutAnimation):
268         (WebCore::ScrollAnimatorGtk::computeVelocity):
269         (WebCore::ScrollAnimatorGtk::handleWheelEvent):
270         (WebCore::ScrollAnimatorGtk::willEndLiveResize):
271         (WebCore::ScrollAnimatorGtk::updatePosition):
272         (WebCore::ScrollAnimatorGtk::didAddVerticalScrollbar):
273         (WebCore::ScrollAnimatorGtk::didAddHorizontalScrollbar):
274         * platform/gtk/ScrollAnimatorGtk.h:
275
276 2017-06-09  Zan Dobersek  <zdobersek@igalia.com>
277
278         [GCrypt] ECDSA signing results can be smaller than the EC key size
279         https://bugs.webkit.org/show_bug.cgi?id=171535
280
281         Reviewed by Jiewen Tan.
282
283         The libgcrypt-based implementation of the ECDSA signing operation does not
284         properly address the resulting `r` and `s` integers that do not potentially
285         match the EC key in terms of size.
286
287         To address that, the retrieved MPI data for both integers is handled depending
288         on the size of said data. Strictly requiring an amount of bytes that matches
289         the key data size N, we simply take the last N bytes if the MPI data is equal
290         or larger than N in size. If smaller, we first append enough zero bytes to the
291         output Vector object before attaching the MPI data in whole so that the amount
292         of appended bytes matches N.
293
294         No new tests -- covers an implementation detail that is not trivial to test,
295         but can rely sufficiently on existing tests.
296
297         * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
298         (WebCore::extractECDSASignatureInteger):
299         (WebCore::gcryptSign):
300
301 2017-06-09  Daewoong Jang  <daewoong.jang@navercorp.com>
302
303         Reduce compiler warnings
304         https://bugs.webkit.org/show_bug.cgi?id=172078
305
306         Reviewed by Yusuke Suzuki.
307
308         * platform/network/curl/CookieJarCurl.cpp:
309         (WebCore::addMatchingCurlCookie):
310         (WebCore::getHostnamesWithCookies):
311         (WebCore::deleteCookiesForHostnames):
312         (WebCore::deleteCookiesForHostname): Deleted.
313         * platform/network/curl/CurlDownload.cpp:
314         (WebCore::CurlDownloadManager::downloadThread):
315         (WebCore::CurlDownload::didReceiveHeader):
316         * platform/network/curl/CurlDownload.h:
317         (WebCore::CurlDownloadListener::didReceiveDataOfLength):
318         * platform/network/curl/ResourceHandleCurl.cpp:
319         (WebCore::WebCoreSynchronousLoader::didReceiveResponse):
320         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
321         * platform/network/curl/SocketStreamHandleImplCurl.cpp:
322         (WebCore::createCopy):
323         (WebCore::SocketStreamHandleImpl::readData):
324
325 2017-06-09  Xabier Rodriguez Calvar  <calvaris@igalia.com>
326
327         [GStreamer][EME] Remove the legacy code that was not even official and is deprecated
328         https://bugs.webkit.org/show_bug.cgi?id=173096
329
330         Reviewed by Žan Doberšek.
331
332         We are removing the LEGACY_ENCRYPTED_MEDIA code that we was not
333         official, is deprecated and we are not planning to support it
334         anymore in any way.
335
336         This also helps implementing current ENCRYPTED_MEDIA in a cleaner
337         way.
338
339         * platform/GStreamer.cmake:
340         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
341         * platform/graphics/gstreamer/GStreamerUtilities.h:
342         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
343         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
344         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
345         (WebCore::registerWebKitGStreamerElements):
346         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
347         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
348         (WebCore::extractEventsAndSystemsFromMessage): Deleted.
349         (WebCore::MediaPlayerPrivateGStreamerBase::needKey): Deleted.
350         (WebCore::MediaPlayerPrivateGStreamerBase::setCDMSession): Deleted.
351         (WebCore::MediaPlayerPrivateGStreamerBase::keyAdded): Deleted.
352         (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent): Deleted.
353         (WebCore::MediaPlayerPrivateGStreamerBase::receivedGenerateKeyRequest): Deleted.
354         (WebCore::keySystemIdToUuid): Deleted.
355         (WebCore::MediaPlayerPrivateGStreamerBase::createSession): Deleted.
356         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey): Deleted.
357         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
358         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
359         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.h:
360         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
361         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
362         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
363         (WebCore::AppendPipeline::AppendPipeline):
364         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
365         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
366         (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
367         (WebCore::appendPipelineElementMessageCallback): Deleted.
368         (WebCore::AppendPipeline::dispatchPendingDecryptionKey): Deleted.
369         (WebCore::AppendPipeline::dispatchDecryptionKey): Deleted.
370         (WebCore::AppendPipeline::handleElementMessage): Deleted.
371         * platform/graphics/gstreamer/mse/AppendPipeline.h:
372         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
373         (WebCore::MediaPlayerPrivateGStreamerMSE::dispatchDecryptionKey): Deleted.
374         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
375
376 2017-06-09  Aaron Chu  <aaron_chu@apple.com>
377
378         AX: Media Controls: Missing labels for the Time Labels.
379         https://bugs.webkit.org/show_bug.cgi?id=171715
380         <rdar://problem/32009214>
381
382         Reviewed by Antoine Quint.
383
384         Added aria-label to describe time labels in media controls.
385
386         * Modules/modern-media-controls/controls/slider.js:
387         (Slider.prototype.set inputAccessibleLabel):
388         (Slider.prototype._formatTime): Deleted.
389         * Modules/modern-media-controls/controls/time-label.js:
390         (TimeLabel.prototype.commitProperty):
391         * Modules/modern-media-controls/main.js:
392         (formatTimeToString):
393
394 2017-06-08  Carlos Garcia Campos  <cgarcia@igalia.com>
395
396         Unreviewed. Fix unused parameter warning after r217955.
397
398         * platform/graphics/FontFamilySpecificationNull.h:
399         (WebCore::FontFamilySpecificationNull::fontRanges):
400
401 2017-06-08  Yoav Weiss  <yoav@yoav.ws>
402
403         [preload] Mandatory `as` value and related spec alignments
404         https://bugs.webkit.org/show_bug.cgi?id=173047
405
406         Reviewed by Dean Jackson.
407
408         Align preload's implementation according to latest spec changes: `as` is mandatory and "fetch" replaces the previous empty `as` value,
409         onerror no longer fires for invalid `as` values, and the IDL for `as` reflects only valid values, to enable feature detection.
410
411         Related standard discussions:
412         https://github.com/w3c/preload/issues/80
413         https://github.com/whatwg/fetch/pull/547
414         https://github.com/whatwg/fetch/pull/549
415         https://github.com/whatwg/html/pull/2588
416
417         No new tests but modified existing ones as well as their expectations.
418
419         * html/HTMLLinkElement.cpp: Add "enumerated attribute" reflection methods to `as`.
420         (WebCore::HTMLLinkElement::setAs):
421         (WebCore::HTMLLinkElement::as):
422         * html/HTMLLinkElement.h:
423         * html/HTMLLinkElement.idl:
424         * loader/LinkLoader.cpp:
425         (WebCore::LinkLoader::loadLinksFromHeader): preloadIfNeeded signature change.
426         (WebCore::LinkLoader::resourceTypeFromAsAttribute): Replace the empty value by "fetch".
427         (WebCore::LinkLoader::preloadIfNeeded): Change the signature, as a LinkLoaderClient is no longer needed, since we don't fire error
428         events from inside the function.
429         (WebCore::LinkLoader::loadLink): preloadIfNeeded signature change.
430         * loader/LinkLoader.h: preloadIfNeeded signature change.
431
432 2017-06-08  Chris Dumez  <cdumez@apple.com>
433
434         [iOS] LowPowerModeNotifier notifies client on non-main thread
435         https://bugs.webkit.org/show_bug.cgi?id=173115
436         <rdar://problem/32644703>
437
438         Reviewed by Ryosuke Niwa.
439
440         Update iOS's implementation of the LowPowerModeNotifier to make sure
441         we notify the client of low power mode changes on the main thread.
442
443         * platform/ios/LowPowerModeNotifierIOS.mm:
444         (-[WebLowPowerModeObserver _didReceiveLowPowerModeChange]):
445
446 2017-06-08  Ryosuke Niwa  <rniwa@webkit.org>
447
448         Crash inside InsertNodeBeforeCommand via InsertParagraphSeparatorCommand
449         https://bugs.webkit.org/show_bug.cgi?id=173085
450         <rdar://problem/32575059>
451
452         Reviewed by Wenson Hsieh.
453
454         The crash was caused by the condition to check for special cases failing when visiblePos is null.
455         Exit early in these extreme cases.
456
457         Also replaced the use of deprecatedNode and deprecatedEditingOffset to modern idioms.
458
459         Test: editing/inserting/insert-horizontal-rule-in-empty-document-crash.html
460
461         * editing/InsertParagraphSeparatorCommand.cpp:
462         (WebCore::InsertParagraphSeparatorCommand::doApply):
463
464 2017-06-08  Ryosuke Niwa  <rniwa@webkit.org>
465
466         The tree scope of an Attr node inside a shadow tree does not updated upon detach.
467         https://bugs.webkit.org/show_bug.cgi?id=173122
468
469         Reviewed by Chris Dumez.
470
471         The crash was caused by the tree scope of an Attr detached from an element inside a shadow root
472         not getting updated.
473
474         Test: fast/dom/detaching-attr-node-in-shadow-tree-crash.html
475
476         * dom/Attr.cpp:
477         (WebCore::Attr::~Attr): Added assertions.
478         (WebCore::Attr::detachFromElementWithValue): Fixed the bug by adopting Attr to Document.
479         (WebCore::Attr::attachToElement): Moved the adoptIfNeeded call here from attachAttributeNodeIfNeeded.
480         * dom/Element.cpp:
481         (WebCore::Element::attachAttributeNodeIfNeeded):
482
483 2017-06-08  Myles C. Maxfield  <mmaxfield@apple.com>
484
485         [Cocoa] Expand system-ui to include every item in the Core Text cascade list
486         https://bugs.webkit.org/show_bug.cgi?id=173043
487         <rdar://problem/21125708>
488
489         Reviewed by Simon Fraser.
490
491         The concept of the system font on Cocoa platforms represents the entire Core Text cascade list.
492         However, previously, WebKit only represented system-ui by pulling out the first item in the Core
493         Text cascade list. Instead, we should make all text rendered with "system-ui" match what the
494         platform would natively render.
495
496         Previously, we walked through the strings in the font-family property and looked them up one by
497         one. However, now we want to abstract this idea of a font family to possibly hold a
498         CTFontDescriptorRef instead of a string. This way, we expand a font-family list of ["fontA",
499         "system-ui", "fontB"] to ["fontA", ... a bunch of CTFontDescriptorRefs ..., "FontB"]. We can
500         then modify the consumer of this object to have two codepaths: the old string-based codepath,
501         and a new, platform-specific codepath which simply embeds the CTFontDesriptorRefs inside a Font
502         object.
503
504         We don't want to simply pull out the family name from each item in the Core Text fallback list
505         because that is a lossy translation. There is more information in these font descriptors which
506         cannot be represented by CSS. Therefore, we must keep the descriptors alive and add the new
507         codepath for them.
508
509         We also don't want to run the CSS font matching algorithm on each member of the Core Text
510         fallback list because it may yield different results from Core Text's font matching algorithm.
511         Our goal is to draw text as closely as possible to the system APIs. If we ran it, we may find
512         a font which is closer to the requested traits, but it would look out of place on the system.
513
514         Tests: fast/text/system-font-fallback-emoji.html
515                fast/text/system-font-fallback.html
516
517         * WebCore.xcodeproj/project.pbxproj:
518         * page/MemoryRelease.cpp:
519         (WebCore::releaseNoncriticalMemory):
520         * platform/graphics/FontCascadeFonts.cpp:
521         (WebCore::realizeNextFallback): The consumer of our new data type. Now uses WTF::visit().
522         (WebCore::FontCascadeFonts::realizeFallbackRangesAt): Now that the number of items to test
523         against the current character is larger than the number of strings in the font-family list,
524         we need to update the existing code to use the correct value.
525         * platform/graphics/FontDescription.cpp: Default implementation for non-Cocoa ports.
526         (WebCore::FontDescription::invalidateCaches):
527         (WebCore::FontCascadeDescription::effectiveFamilyCount):
528         (WebCore::FontCascadeDescription::effectiveFamilyAt):
529         * platform/graphics/FontDescription.h: Our new data type is a Variant of AtomicString and a
530         platform-specific class. Cocoa uses a class that holds a CTFontDescriptorRef and other ports
531         use an empty non-constructable class.
532         * platform/graphics/FontFamilySpecificationNull.h: Added. The empty non-constructable
533         class.
534         (WebCore::FontFamilySpecificationNull::fontRanges):
535         * platform/graphics/cocoa/FontCacheCoreText.cpp:
536         (WebCore::FontCache::platformInit): Changing the system language will change the system font
537         fallback list, so we need to listen to this notification. This also matters for
538         FontCache::systemFallbackForCharacters(), so we should build off the same callback we are
539         already using for font installation.
540         (WebCore::invalidateFontCache):
541         * platform/graphics/cocoa/FontDescriptionCocoa.cpp: Added. The platform-specific creation of
542         our CTFontDescriptorRefs. We hold them cached in a SystemFontDatabase.
543         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParameters):
544         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::isHashTableDeletedValue):
545         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator==):
546         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash):
547         (WebCore::SystemFontDatabase::singleton):
548         (WebCore::SystemFontDatabase::systemFontCascadeList):
549         (WebCore::SystemFontDatabase::clear):
550         (WebCore::SystemFontDatabase::SystemFontDatabase):
551         (WebCore::SystemFontDatabase::applyWeightAndItalics):
552         (WebCore::SystemFontDatabase::computeCascadeList):
553         (WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::hash):
554         (WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::equal):
555         (WebCore::isSystemFontString):
556         (WebCore::systemFontParameters):
557         (WebCore::FontDescription::invalidateCaches):
558         (WebCore::FontCascadeDescription::effectiveFamilyCount): We don't store the result of this
559         because it would probably be a bad idea to increase the size of every single FontCascade just
560         in case it might ask for the system font. Most fonts never mention system-ui. Because it's so
561         rare, we can just recalculate the result of this as necessary. This shouldn't be slow because
562         the results are cached.
563         (WebCore::FontCascadeDescription::effectiveFamilyAt):
564         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp: Added.
565         (WebCore::FontFamilySpecificationCoreText::fontRanges): Create a FontRanges from a
566         CTFontDescriptorRef.
567         * platform/graphics/cocoa/FontFamilySpecificationCoreText.h: Added.
568         (WebCore::FontFamilySpecificationCoreText::FontFamilySpecificationCoreText):
569         * platform/graphics/ios/FontCacheIOS.mm: Delete the old handling for system-ui.
570         (WebCore::platformFontWithFamilySpecialCase):
571         (WebCore::baseSystemFontDescriptor): Deleted.
572         (WebCore::systemFontModificationAttributes): Deleted.
573         (WebCore::systemFontDescriptor): Deleted.
574         * platform/graphics/mac/FontCacheMac.mm: Ditto.
575         (WebCore::platformFontWithFamilySpecialCase):
576         (WebCore::toNSFontWeight): Deleted.
577
578 2017-06-08  Chris Dumez  <cdumez@apple.com>
579
580         Update Timer to take a WTF::Function instead of a std::function
581         https://bugs.webkit.org/show_bug.cgi?id=173113
582
583         Reviewed by Brady Eidson.
584
585         Update Timer to take a WTF::Function instead of a std::function as we prefer
586         to use WTF::Function in WebKit.
587
588         * platform/GenericTaskQueue.cpp:
589         (WebCore::TaskDispatcher<Timer>::sharedTimer):
590         * platform/Timer.h:
591         (WebCore::Timer::Timer):
592         (WebCore::DeferrableOneShotTimer::DeferrableOneShotTimer):
593
594 2017-06-08  Carlos Alberto Lopez Perez  <clopez@igalia.com>
595
596         [WebRTC] enableMockMediaEndpoint() is only used for the OpenWebRTC backend.
597         https://bugs.webkit.org/show_bug.cgi?id=173108
598
599         Reviewed by Eric Carlson.
600
601         Covered by existing tests.
602
603         * testing/Internals.cpp:
604         (WebCore::Internals::Internals):
605         (WebCore::Internals::enableMockMediaEndpoint):
606         * testing/Internals.h:
607
608 2017-06-08  Antoine Quint  <graouts@apple.com>
609
610         [iOS] Buttons in top-left and bottom media controls bar are positioned too high
611         https://bugs.webkit.org/show_bug.cgi?id=173111
612         <rdar://problem/32650615>
613
614         Reviewed by Jon Lee.
615
616         Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-button-padding.html
617
618         Since we use flex box to vertically center buttons in a buttons container, there is no
619         need to offset the button due to padding in the y-axis.
620
621         * Modules/modern-media-controls/controls/buttons-container.css:
622         (.ios .buttons-container button):
623
624 2017-06-08  Jeremy Jones  <jeremyj@apple.com>
625
626         Implement additional AVPlayerController interfaces for minTime and maxTime.
627         https://bugs.webkit.org/show_bug.cgi?id=172396
628         rdar://problem/30737452
629
630         Reviewed by Jer Noble.
631
632         No new tests because no change to DOM.
633
634         Add support for new HLS UI in AVKit.
635
636         This adds new properties (seekableTimeRangesLastModifiedTime, liveUpdateInterval, minTiming, maxTiming) to WebAVPlayerController.
637         Plumb these properties from AVPlayer up to AVKit.
638
639         Switch WebPlaybackSessionModelMediaElement from updating seekableRangesChanged using timeupdate event to using progress event.
640
641         Enable progress events on iOS.
642
643         * html/HTMLMediaElement.cpp:
644         (WebCore::HTMLMediaElement::HTMLMediaElement):
645         (WebCore::HTMLMediaElement::loadResource):
646         (WebCore::HTMLMediaElement::seekableTimeRangesLastModifiedTime):
647         (WebCore::HTMLMediaElement::liveUpdateInterval):
648         * html/HTMLMediaElement.h:
649         * platform/cf/CoreMediaSoftLink.cpp:
650         * platform/cf/CoreMediaSoftLink.h:
651         * platform/cocoa/WebPlaybackSessionModel.h:
652         (WebCore::WebPlaybackSessionModelClient::seekableRangesChanged):
653         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
654         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
655         (WebCore::WebPlaybackSessionModelMediaElement::updateForEventName):
656         (WebCore::WebPlaybackSessionModelMediaElement::observedEventNames):
657         (WebCore::WebPlaybackSessionModelMediaElement::seekableTimeRangesLastModifiedTime):
658         (WebCore::WebPlaybackSessionModelMediaElement::liveUpdateInterval):
659         * platform/graphics/MediaPlayer.cpp:
660         (WebCore::MediaPlayer::seekableTimeRangesLastModifiedTime):
661         (WebCore::MediaPlayer::liveUpdateInterval):
662         * platform/graphics/MediaPlayer.h:
663         * platform/graphics/MediaPlayerPrivate.h:
664         (WebCore::MediaPlayerPrivateInterface::seekableTimeRangesLastModifiedTime):
665         (WebCore::MediaPlayerPrivateInterface::liveUpdateInterval):
666         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
667         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
668         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesLastModifiedTime):
669         (WebCore::MediaPlayerPrivateAVFoundationObjC::liveUpdateInterval):
670         * platform/ios/WebAVPlayerController.h:
671         * platform/ios/WebAVPlayerController.mm:
672         (-[WebAVPlayerController init]):
673         (-[WebAVPlayerController dealloc]):
674         (-[WebAVPlayerController observeValueForKeyPath:ofObject:change:context:]):
675         (-[WebAVPlayerController updateMinMaxTiming]):
676         (-[WebAVPlayerController hasSeekableLiveStreamingContent]):
677         (+[WebAVPlayerController keyPathsForValuesAffectingHasSeekableLiveStreamingContent]):
678         (-[WebAVPlayerController resetMediaState]):
679         * platform/ios/WebPlaybackSessionInterfaceAVKit.h:
680         * platform/ios/WebPlaybackSessionInterfaceAVKit.mm:
681         (WebCore::WebPlaybackSessionInterfaceAVKit::WebPlaybackSessionInterfaceAVKit):
682         (WebCore::WebPlaybackSessionInterfaceAVKit::resetMediaState):
683         (WebCore::WebPlaybackSessionInterfaceAVKit::seekableRangesChanged):
684         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
685         (WebVideoFullscreenControllerContext::seekableRangesChanged):
686         (WebVideoFullscreenControllerContext::seekableTimeRangesLastModifiedTime):
687         (WebVideoFullscreenControllerContext::liveUpdateInterval):
688         * platform/mac/WebPlaybackSessionInterfaceMac.h:
689         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
690         (WebCore::WebPlaybackSessionInterfaceMac::seekableRangesChanged):
691         * platform/spi/cocoa/AVKitSPI.h:
692         * platform/spi/mac/AVFoundationSPI.h:
693
694 2017-06-07  Dave Hyatt  <hyatt@apple.com>
695
696         Laili restaurant menu page does not display full menu
697         https://bugs.webkit.org/show_bug.cgi?id=173062
698         rdar://problem/32436486
699
700         Reviewed by Simon Fraser.
701
702         Percentage heights inside auto containing blocks were handled correctly by
703         hasReplacedLogicalHeight, which checked hasAutoHeightOrContainingBlockWithAutoHeight
704         properly. min-max-height were not handled properly though and need to do the same check.
705         
706         There is also now a quirk for iBooks to preserve the old behavior, since they depend
707         on the old behavior to constrain the height of images to a page.
708
709         Test: fast/replaced/max-height-percent-inside-auto-block.html
710
711         * rendering/RenderBox.cpp:
712         (WebCore::RenderBox::replacedMinMaxLogicalHeightComputesAsNone):
713         Add a new helper that resolves min and max logical height values to none for
714         replaced elements with percentage min/max heights inside auto containing blocks.
715
716         (WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
717         Change the min/max-height constraint function for replaced elements to call the
718         new helper function.
719
720         * rendering/RenderBox.h:
721         * rendering/RenderBoxModelObject.h:
722         Move a function from private to protected so that RenderBox can access it.
723
724 2017-06-08  Tim Horton  <timothy_horton@apple.com>
725
726         Add a borderless mode to <attachment>, and make it respect its layout size
727         https://bugs.webkit.org/show_bug.cgi?id=173079
728         <rdar://problem/32491584>
729
730         Reviewed by Simon Fraser.
731
732         Tests: fast/attachment/attachment-borderless.html
733                fast/attachment/attachment-respects-css-size.html
734
735         * css/CSSPrimitiveValueMappings.h:
736         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
737         * css/CSSValueKeywords.in:
738         * platform/ThemeTypes.h:
739         * rendering/RenderAttachment.cpp:
740         (WebCore::RenderAttachment::shouldDrawBorder):
741         * rendering/RenderAttachment.h:
742         * rendering/RenderTheme.cpp:
743         (WebCore::RenderTheme::adjustStyle):
744         (WebCore::RenderTheme::paint):
745         Add "-webkit-appearance: borderless-attachment;" in addition to "attachment",
746         so clients can specify the borderless appearance. This isn't specified as a
747         CSS border because it's a very custom appearance that isn't achievable that way.
748
749         * rendering/RenderThemeIOS.mm:
750         (WebCore::AttachmentInfo::AttachmentInfo):
751         Use the layout size of the attachment, not the fixed size; we use the fixed
752         size as our intrinsic size, so most attachments will still be that size,
753         but if a client specifies a different size, we'll lay out correctly.
754
755 2017-06-08  Jer Noble  <jer.noble@apple.com>
756
757         YouTube audio stutters when page changes visibility.
758         https://bugs.webkit.org/show_bug.cgi?id=173102
759
760         Reviewed by Eric Carlson.
761
762         Don't change renderers when the visibility changes; only use the decompression session
763         when we were explicitly asked to paint into an accelerated surface.
764
765         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
766         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::acceleratedRenderingStateChanged):
767
768 2017-06-08  Jer Noble  <jer.noble@apple.com>
769
770         Clients of the WK2 C-API don't have their mediaContentTypesRequiringHardwareSupport setting initialized correctly.
771         https://bugs.webkit.org/show_bug.cgi?id=173091
772
773         Reviewed by Eric Carlson.
774
775         Add a new default setting value, defined separately in Settings and SettingsCocoa.
776
777         * page/Settings.cpp:
778         (WebCore::Settings::defaultMediaContentTypesRequiringHardwareSupport):
779         * page/Settings.h:
780         * page/cocoa/SettingsCocoa.mm:
781         (WebCore::Settings::defaultMediaContentTypesRequiringHardwareSupport):
782
783 2017-06-08  Jer Noble  <jer.noble@apple.com>
784
785         Take the mediaContentTypesRequiringHardwareSupport Setting into account when answering HTMLMediaElement::canPlayType()
786         https://bugs.webkit.org/show_bug.cgi?id=173092
787
788         Reviewed by Eric Carlson.
789
790         Pass the value of mediaContentTypesRequiringHardwareSupport into the MediaPlayer when querying canPlayType().
791         Then, use the existing code in AVAssetTrackUtilities to know whether to bail out early from the codec check.
792
793         Drive-by fix: FourCC was converting String -> FourCC in reverse.
794
795         * html/HTMLMediaElement.cpp:
796         (WebCore::HTMLMediaElement::canPlayType):
797         * platform/graphics/FourCC.cpp:
798         (WebCore::FourCC::fromString):
799         * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.h:
800         * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
801         (WebCore::contentTypesToCodecs):
802         (WebCore::codecsMeetHardwareDecodeRequirements):
803         (WebCore::contentTypeMeetsHardwareDecodeRequirements):
804         (WebCore::assetTrackMeetsHardwareDecodeRequirements):
805         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
806         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
807         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
808         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
809
810 2017-06-08  Chris Dumez  <cdumez@apple.com>
811
812         ASSERTION FAILED: !m_isolatedWorld->isNormal() || m_wrapper || !m_jsFunction on webrtc/ephemeral-certificates-and-cnames.html
813         https://bugs.webkit.org/show_bug.cgi?id=173039
814         <rdar://problem/32600412>
815
816         Reviewed by Youenn Fablet.
817
818         RTCPeerConnection was an ActiveDOMObject but failed to override ActiveDOMObject::hasPendingActivity()
819         to make sure its JS wrapper stays alive as long as it needs to. In this patch, we override
820         ActiveDOMObject::hasPendingActivity() and have it return true if !m_isStopped. I believe this is
821         the right thing to do to keep the wrapper alive as long as the connection is not closed.
822         RTCPeerConnection::close() closes the connection and then posts a task to call
823         RTCPeerConnection::doStop(), setting m_isStopped to true.
824
825         No new tests, already covered by webrtc/ephemeral-certificates-and-cnames.html which
826         was a flaky crash.
827
828         * Modules/mediastream/RTCPeerConnection.cpp:
829         (WebCore::RTCPeerConnection::canSuspendForDocumentSuspension):
830         (WebCore::RTCPeerConnection::hasPendingActivity):
831         * Modules/mediastream/RTCPeerConnection.h:
832
833 2017-06-08  Miguel Gomez  <magomez@igalia.com>
834
835         [GTK][WPE][GSTREAMER_GL] Change the colorspace used by the video frames provided by GStreamer
836         https://bugs.webkit.org/show_bug.cgi?id=173050
837
838         Reviewed by Žan Doberšek.
839
840         We are currently requesting RGBA as the color format of the video frames to gstreamer. This is a problem
841         because when those frames are rendered with the CPU, the R and B components are swapped as cairo expects
842         ARGB and GStreamer delivers ABGR.
843
844         In order to fix this without performing color conversions on the CPU, what we do is change the format
845         used by GStreamer for the video frames. We do that taking into account the endianness used. So with
846         little endian we will use BGRx or BGRA and with big endian xRGB or ARGB. Thanks to this, when downloading
847         the frames to the CPU they will automatically be turned into the ARGB expected by cairo. Also, when
848         rendering the frames using OpenGL, we indicate that the color space needs to be converted to the RGBA
849         expected by the destination texture (but this color conversion is performed by the GPU so there's no
850         penalty).
851
852         Covered by existent tests.
853
854         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
855         (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
856         (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
857         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
858         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):
859         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
860         (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
861         (WebCore::VideoTextureCopierGStreamer::updateColorConversionMatrix):
862         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
863         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
864         * platform/graphics/texmap/TextureMapperGL.cpp:
865         (WebCore::colorSpaceMatrixForFlags):
866         * platform/graphics/texmap/TextureMapperGL.h:
867
868 2017-06-07  Ryosuke Niwa  <rniwa@webkit.org>
869
870         IsInShadowTreeFlag does not get updated for a non-container node
871         https://bugs.webkit.org/show_bug.cgi?id=173084
872
873         Reviewed by Antti Koivisto.
874
875         insertedInto and removedFrom were only called on ContainerNode nodes when they're not connected to a document.
876         As a result IsInShadowTreeFlag could have gotten out-of-date when a node was inserted or removed from a shadow root
877         which is not connected to a document.
878
879         Fixed this inconsistency by always falling insertedInto and removedFrom on all nodes.
880
881         * dom/ContainerNodeAlgorithms.cpp:
882         (WebCore::notifyNodeInsertedIntoDocument): Merged notifyDescendantInsertedIntoDocument. Now takes a Node instead
883         of a ContainerNode.
884         (WebCore::notifyNodeInsertedIntoTree): Merged notifyDescendantInsertedIntoTree. Now takes a Node instead of
885         a ContainerNode.
886         (WebCore::notifyChildNodeInserted): Always call notifyNodeInsertedIntoTree on an inserted node.
887         (WebCore::notifyNodeRemovedFromDocument): Now takes a Node instead of a ContainerNode.
888         (WebCore::notifyNodeRemovedFromTree): Ditto.
889         (WebCore::notifyChildNodeRemoved): Always call notifyNodeRemovedFromTree on an inserted node.
890         (WebCore::addChildNodesToDeletionQueue): Directly call adoptIfNeeded on document() since onwerDocument() only returns
891         nullptr on a Document node but this function is never called on a root node and Document can only be a root node.
892         Also assert that a node not put into the deletion queue is no longer in a document or a shadow tree.
893
894         * dom/Node.cpp:
895         (WebCore::Node::insertedInto): Removed the assertion that's no longer true.
896         (WebCore::Node::removedFrom): Ditto.
897
898 2017-06-07  Carlos Garcia Campos  <cgarcia@igalia.com>
899
900         [WPE] Enable resource usage
901         https://bugs.webkit.org/show_bug.cgi?id=173054
902
903         Reviewed by Žan Doberšek.
904
905         Add resource usage linux files to the compilation.
906
907         * PlatformWPE.cmake:
908
909 2017-06-07  Jer Noble  <jer.noble@apple.com>
910
911         [Web Audio] createScriptProcessor throws IndexSizeError for valid arguments
912         https://bugs.webkit.org/show_bug.cgi?id=173022
913
914         Reviewed by Sam Weinig.
915
916         Updated test: webaudio/javascriptaudionode.html
917
918         The Web Audio spec (<https://webaudio.github.io/web-audio-api/>, 06 June 2017) defines a default behavior when
919         clients pass in a value of 0 for bufferSize to the createScriptProcessor() method.
920
921         * Modules/webaudio/AudioContext.cpp:
922         (WebCore::AudioContext::createScriptProcessor):
923         * Modules/webaudio/AudioContext.idl:
924         * Modules/webaudio/ScriptProcessorNode.cpp:
925         (WebCore::ScriptProcessorNode::create):
926         * Modules/webaudio/ScriptProcessorNode.h:
927
928 2017-06-07  Chris Dumez  <cdumez@apple.com>
929
930         CSSStyleRule.style / CSSPageRule.style / CSSKeyframeRule.style should be settable
931         https://bugs.webkit.org/show_bug.cgi?id=164537
932         <rdar://problem/29181773>
933
934         Reviewed by Sam Weinig.
935
936         CSSStyleRule.style / CSSPageRule.style / CSSKeyframeRule.style should be settable
937         as per:
938         - https://drafts.csswg.org/cssom/#the-cssstylerule-interface
939         - https://drafts.csswg.org/cssom/#the-csspagerule-interface
940         - https://drafts.csswg.org/css-animations/#interface-csskeyframerule
941
942         Tests:
943         http/wpt/cssom/CSSPageRule.html
944         imported/w3c/web-platform-tests/cssom/CSSKeyframeRule.html
945         imported/w3c/web-platform-tests/cssom/CSSStyleRule.html
946         imported/w3c/web-platform-tests/cssom/interfaces.html
947
948         * css/CSSKeyframeRule.idl:
949         * css/CSSPageRule.idl:
950         * css/CSSStyleRule.idl:
951
952 2017-06-07  Sam Weinig  <sam@webkit.org>
953
954         [WebIDL] Split up attribute generation to match operation generation
955         https://bugs.webkit.org/show_bug.cgi?id=173072
956
957         Reviewed by Chris Dumez.
958
959         * bindings/js/JSDOMAttribute.h:
960         (WebCore::IDLAttribute::setStatic):
961         (WebCore::IDLAttribute::getStatic):
962         Add static variants of get/set matching the one in IDLOperation.
963
964         * bindings/scripts/CodeGeneratorJS.pm:
965         (GetFullyQualifiedImplementationCallName):
966         Factor out duplicate code to compute the qualified name for a function call.
967
968         (AddAdditionalArgumentsForImplementationCall):
969         Factor out duplicate code to compute the some standard arguments for a function
970         call. We may want to merge this with GenerateCallWith.
971
972         (GenerateHeader):
973         Update for new signature of HasCustom... subroutines.
974         
975         (GenerateImplementation):
976         Pass @implContent to more helper generators to continue propagating the idiom.
977
978         (GenerateAttributeGetterBodyDefinition):
979         (GenerateAttributeGetterTrampolineDefinition):
980         (GenerateAttributeGetterDefinition):
981         (GenerateAttributeSetterBodyDefinition):
982         (GenerateAttributeSetterTrampolineDefinition):
983         (GenerateAttributeSetterDefinition):
984         Split attribute getter and setter generation up by having separate subroutines 
985         to generate the trampoline and body. Also, make all attributes, even static ones
986         use a trampoline to simplify the code. Static attributes got through a no-op 
987         trampoline, that gets compiled away. Also adopt GetFullyQualifiedImplementationCallName
988         and AddAdditionalArgumentsForImplementationCall to reduce duplication.
989
990         (GenerateOperationBodyDefinition):
991         (GenerateOperationDefinition):
992         Adopt $outputArray idiom and adopt GetFullyQualifiedImplementationCallName
993         and AddAdditionalArgumentsForImplementationCall to reduce duplication
994
995         (GenerateParametersCheck):
996         Adopt GetFullyQualifiedImplementationCallName and AddAdditionalArgumentsForImplementationCall 
997         to reduce duplication.
998
999         (HasCustomGetter):
1000         (HasCustomSetter):
1001         (HasCustomMethod):
1002         Convert HasCustom... subroutines to take an IDLAttribute rather than the extended
1003         attributes, matching other predicates
1004
1005         * bindings/scripts/test/JS/JSTestInterface.cpp:
1006         * bindings/scripts/test/JS/JSTestObj.cpp:
1007         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1008         Update test results.
1009
1010 2017-06-07  Youenn Fablet  <youenn@apple.com>
1011
1012         RTCTrackEvent.track should be found in RTCTrackEvent.streams[0]
1013         https://bugs.webkit.org/show_bug.cgi?id=173074
1014
1015         Reviewed by Eric Carlson.
1016
1017         Covered by updated test.
1018
1019         * Modules/mediastream/MediaStream.cpp:
1020         (WebCore::MediaStream::addTrackFromPlatform):
1021
1022 2017-06-07  Devin Rousso  <drousso@apple.com>
1023
1024         Web Inspector: Add ContextMenu item to log WebSocket object to console
1025         https://bugs.webkit.org/show_bug.cgi?id=172878
1026
1027         Reviewed by Joseph Pecoraro.
1028
1029         Test: http/tests/websocket/tests/hybi/inspector/resolveWebSocket.html
1030
1031         * inspector/InspectorNetworkAgent.h:
1032         * inspector/InspectorNetworkAgent.cpp:
1033         (WebCore::InspectorNetworkAgent::InspectorNetworkAgent):
1034         (WebCore::InspectorNetworkAgent::webSocketForRequestId):
1035         (WebCore::webSocketAsScriptValue):
1036         (WebCore::InspectorNetworkAgent::resolveWebSocket):
1037         Loops over the static allActiveWebSockets to find one with the given requestId. If found, it
1038         will create a RemoteObject wrapper for it and send it back to the inspector.
1039
1040 2017-06-07  Devin Rousso  <drousso@apple.com>
1041
1042         Web Inspector: Allow user to choose stylesheet when creating new rules
1043         https://bugs.webkit.org/show_bug.cgi?id=172487
1044
1045         Reviewed by Joseph Pecoraro.
1046
1047         New test: inspector/css/add-rule.html
1048
1049         * inspector/InspectorStyleSheet.cpp:
1050         (WebCore::InspectorStyleSheet::addRule):
1051         Reparse the content when a new rule is added to a non-inspector origin stylesheet.
1052
1053 2017-06-07  Youenn Fablet  <youenn@apple.com>
1054
1055         getUserMedia is prompting too often
1056         https://bugs.webkit.org/show_bug.cgi?id=172859
1057         <rdar://problem/32589950>
1058
1059         Reviewed by Eric Carlson.
1060
1061         Tests: fast/mediastream/getUserMedia-grant-persistency-reload.html
1062                fast/mediastream/getUserMedia-grant-persistency.html
1063
1064         * loader/FrameLoaderClient.h:
1065         * page/Frame.cpp:
1066         (WebCore::Frame::setDocument): Allows notifying of change of main frame document.
1067         UIProcess will use that to remove unneeded previously granted gum permission.
1068
1069 2017-06-07  Chris Dumez  <cdumez@apple.com>
1070
1071         Align <col span>/<colgroup span> limits with the latest HTML specification
1072         https://bugs.webkit.org/show_bug.cgi?id=173049
1073
1074         Reviewed by Daniel Bates.
1075
1076         Align <col span>/<colgroup span> limits with the latest HTML specification after:
1077         - https://github.com/whatwg/html/issues/2705
1078         - https://github.com/whatwg/html/pull/2734
1079
1080         In particular, col / colspan's span attribute is now clamped to the [1, 1000] range.
1081
1082         Test: imported/w3c/web-platform-tests/html/semantics/tabular-data/processing-model-1/col-span-limits.html
1083
1084         [1] https://html.spec.whatwg.org/#dom-colgroup-span
1085         [2] https://html.spec.whatwg.org/#clamped-to-the-range
1086         [3] https://github.com/whatwg/html/pull/2734/files
1087
1088         * html/HTMLTableColElement.cpp:
1089         (WebCore::HTMLTableColElement::parseAttribute):
1090         As per [1][2], the span attribute should be clamped to the range [1, 1000] with a default value of 1 (on getting).
1091
1092         (WebCore::HTMLTableColElement::setSpan):
1093         As per [2], on setting, we should behave the same as setting a regular reflected unsigned integer when an attribute
1094         is clamped to a range. Therefore, we now call limitToOnlyHTMLNonNegative() instead of
1095         limitToOnlyHTMLNonNegativeNumbersGreaterThanZero(). We used to call limitToOnlyHTMLNonNegativeNumbersGreaterThanZero()
1096         because the value used to be limited to only non-negative numbers greater than zero with fallback before [3]. Without
1097         this change, "col.span = 0" would set the content attribute to 1 instead of 0, which would be wrong.
1098
1099 2017-06-07  Jer Noble  <jer.noble@apple.com>
1100
1101         Exempt exclusively wall-powered devices from hardware codec requirement
1102         https://bugs.webkit.org/show_bug.cgi?id=173009
1103
1104         Reviewed by Eric Carlson.
1105
1106         * WebCore.xcodeproj/project.pbxproj:
1107         * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
1108         (WebCore::systemHasBattery):
1109         (WebCore::assetTrackMeetsHardwareDecodeRequirements):
1110         * platform/spi/cocoa/IOPSLibSPI.h: Added.
1111
1112 2017-06-07  Jer Noble  <jer.noble@apple.com>
1113
1114         Refactoring: MediaEngineSupportParameters should take a ContentType rather than separate type & codecs strings
1115         https://bugs.webkit.org/show_bug.cgi?id=173038
1116
1117         Reviewed by Eric Carlson.
1118
1119         * Modules/encryptedmedia/CDM.cpp:
1120         (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
1121         * Modules/mediasource/MediaSource.cpp:
1122         (WebCore::MediaSource::addSourceBuffer):
1123         (WebCore::MediaSource::isTypeSupported):
1124         * dom/DOMImplementation.cpp:
1125         (WebCore::DOMImplementation::createDocument):
1126         * html/HTMLMediaElement.cpp:
1127         (WebCore::HTMLMediaElement::canPlayType):
1128         (WebCore::HTMLMediaElement::selectNextSourceChild):
1129         * platform/ContentType.cpp:
1130         (WebCore::ContentType::codecsParameter):
1131         (WebCore::ContentType::profilesParameter):
1132         (WebCore::ContentType::containerType):
1133         (WebCore::simplifyWhitespace):
1134         (WebCore::ContentType::codecs):
1135         (WebCore::ContentType::profiles):
1136         (WebCore::ContentType::type): Deleted.
1137         * platform/ContentType.h:
1138         * platform/graphics/MediaPlayer.cpp:
1139         (WebCore::bestMediaEngineForSupportParameters):
1140         (WebCore::MediaPlayer::load):
1141         (WebCore::MediaPlayer::nextBestMediaEngine):
1142         (WebCore::MediaPlayer::loadWithNextMediaEngine):
1143         (WebCore::MediaPlayer::supportsType):
1144         (WebCore::MediaPlayer::networkStateChanged):
1145         (WebCore::codecs): Deleted.
1146         * platform/graphics/MediaPlayer.h:
1147         (WebCore::MediaPlayer::contentMIMEType):
1148         (WebCore::MediaPlayer::contentTypeCodecs):
1149         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
1150         (WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystemAndMimeType):
1151         (WebCore::CDMPrivateMediaSourceAVFObjC::supportsMIMEType):
1152         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1153         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsType):
1154         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1155         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
1156         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
1157         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1158         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
1159         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
1160         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
1161         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1162         (WebCore::MediaPlayerPrivateGStreamer::supportsType):
1163         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1164         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
1165         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1166         (WebCore::MediaPlayerPrivateQTKit::supportsType):
1167         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1168         (WebCore::MediaPlayerPrivateMediaFoundation::supportsType):
1169         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
1170         (WebCore::MockMediaPlayerMediaSource::supportsType):
1171         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
1172         (WebCore::MockMediaSourcePrivate::addSourceBuffer):
1173
1174 2017-06-07  Ryosuke Niwa  <rniwa@webkit.org>
1175
1176         Use a dedicated node flag to identify a Document node
1177         https://bugs.webkit.org/show_bug.cgi?id=173037
1178
1179         Reviewed by Chris Dumez.
1180
1181         Address Antti's review comment. We don't need a new Node flg.
1182
1183         * dom/Node.h:
1184         (WebCore::Node::isDocumentNode):
1185
1186 2017-06-07  Jon Davis  <jond@apple.com>
1187
1188         Update feature status for features Supported In Preview
1189         https://bugs.webkit.org/show_bug.cgi?id=173071
1190
1191         Reviewed by Darin Adler.
1192
1193         Updated WebAssembly.
1194
1195         * features.json:
1196
1197 2017-06-07  Sam Weinig  <sam@webkit.org>
1198
1199         [WebIDL] PutForwards is not implemented to spec as illustrated by the WPT WebIDL/ecmascript-binding/put-forwards.html
1200         https://bugs.webkit.org/show_bug.cgi?id=172956
1201
1202         Reviewed by Chris Dumez.
1203
1204         Implements step 3.5.9 of https://heycam.github.io/webidl/#dfn-attribute-setter.
1205
1206         * bindings/scripts/CodeGeneratorJS.pm:
1207         (GenerateAttributeSetterDefinition):
1208         Implement [PutForwards] to spec, which involves using JSC get/set rather than calling
1209         directly into the implementation.
1210
1211         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1212         * bindings/scripts/test/JS/JSTestObj.cpp:
1213         Update test results.
1214
1215 2017-06-07  Jer Noble  <jer.noble@apple.com>
1216
1217         Clean-up: RenderElement.h includes headers it doesn't use
1218         https://bugs.webkit.org/show_bug.cgi?id=173046
1219
1220         Reviewed by Andy Estes.
1221
1222         Remove a couple of unneeded includes from RenderElement.h, and then clean up all the
1223         follow-on compile errors that causes. Mostly, these errors are fixed by including the
1224         correct headers at the point of use; otherwise, they're solved by forward-declaring types
1225         and in one case by moving default constructors implementation to the cpp file from the header.
1226
1227         * css/parser/SizesAttributeParser.cpp:
1228         * editing/cocoa/EditorCocoa.mm:
1229         * platform/mac/PasteboardMac.mm:
1230         * rendering/InlineIterator.h:
1231         (WebCore::embedCharFromDirection):
1232         * rendering/RenderBoxModelObject.h:
1233         * rendering/RenderElement.cpp:
1234         * rendering/RenderElement.h:
1235         * rendering/RenderIterator.h:
1236         * rendering/RenderLineBreak.cpp:
1237         * rendering/RenderQuote.cpp:
1238         * rendering/RenderText.h:
1239         * rendering/SimpleLineLayoutPagination.cpp:
1240         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1241         * rendering/TextAutoSizing.cpp:
1242         * rendering/style/RenderStyle.cpp:
1243         * rendering/style/RenderStyle.h:
1244         * style/RenderTreeUpdater.cpp:
1245         * style/StyleResolveForDocument.cpp:
1246         * style/StyleTreeResolver.cpp:
1247
1248 2017-06-07  Youenn Fablet  <youenn@apple.com>
1249
1250         Add WebRTC stats logging
1251         https://bugs.webkit.org/show_bug.cgi?id=173045
1252
1253         Reviewed by Eric Carlson.
1254
1255         No change of behavior.
1256
1257         Do release logging of WebRTC stats once remote description is set.
1258         Do logging every second for the first 30 seconds.
1259         After 30 seconds, do release logging of these stats every 5 seconds.
1260
1261         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1262         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
1263         (WebCore::LibWebRTCMediaEndpoint::stop):
1264         (WebCore::LibWebRTCMediaEndpoint::gatherStatsForLogging):
1265         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
1266         (WebCore::LibWebRTCMediaEndpoint::startLoggingStats):
1267         (WebCore::LibWebRTCMediaEndpoint::stopLoggingStats):
1268         (WebCore::LibWebRTCPeerConnectionBackend::doSetRemoteDescription):
1269
1270 2017-06-07  Per Arne Vollan  <pvollan@apple.com>
1271
1272         Support removal of authentication data through the Website data store API.
1273         https://bugs.webkit.org/show_bug.cgi?id=171217
1274
1275         Reviewed by Brady Eidson.
1276
1277         Add support to remove and fetch credential data through the Website data store API.
1278
1279         Test: http/tests/loading/basic-auth-remove-credentials.html
1280
1281         * platform/network/CredentialStorage.h:
1282         (WebCore::CredentialStorage::originsWithCredentials):
1283
1284 2017-06-07  Per Arne Vollan  <pvollan@apple.com>
1285
1286         AudioSourceProviderAVFObjC::m_tap member access is not thread safe.
1287         https://bugs.webkit.org/show_bug.cgi?id=172263
1288
1289         Reviewed by Darin Adler.
1290
1291         It it possible that the main thread will modify the m_tap member by calling
1292         AudioSourceProviderAVFObjC::destroyMix(), while m_tap is being read on a secondary
1293         thread under AudioSourceProviderAVFObjC::processCallback(). Instead of accessing
1294         the m_tap member on the secondary thread, we can use the same MTAudioProcessingTapRef
1295         provided by MediaToolbox in the callback. We assume the tap ref is retained by
1296         MediaToolbox, so it should be safe to use even if the the m_tap member is set to null.
1297
1298         Covered by existing tests.
1299
1300         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
1301         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1302         (WebCore::AudioSourceProviderAVFObjC::processCallback):
1303         (WebCore::AudioSourceProviderAVFObjC::process):
1304
1305 2017-06-07  Zan Dobersek  <zdobersek@igalia.com>
1306
1307         [GCrypt] RSA-PSS support
1308         https://bugs.webkit.org/show_bug.cgi?id=172856
1309
1310         Reviewed by Jiewen Tan.
1311
1312         Implement RSA-PSS support for Web Crypto API in ports that use libgcrypt.
1313
1314         For the signing operation, the digest algorithm is determined and used to
1315         compute the hash of the passed-in data. The given salt length and hash results
1316         are embedded into a data s-expression, specifying PSS as the preferred type of
1317         padding. This s-expression and the provided key are then passed to the
1318         gcry_pk_sign() call which computes the signature. The MPI data of this signature
1319         is retrieved and its size validated before being passed to the success callback.
1320
1321         For the verification operation, the hash of the passed-in data is computed as
1322         before, embedding it into a data s-expression along with the specified salt
1323         length. The passed-in signature data is embedded into a sig-val s-expression.
1324         The two s-expressions are passed to the gcry_pk_verify() call along with the
1325         key. If the returned error code for this operation is GPG_ERR_NO_ERROR the
1326         verification is deemed successful, while in case of any other error code (which
1327         might indicate a verification failure or an operation error) we simply signal
1328         that the verification step failed (and not that it possibly errored out).
1329
1330         No new tests -- covered by existing tests.
1331
1332         * PlatformGTK.cmake: Add the new build targets.
1333         * PlatformWPE.cmake: Ditto.
1334         * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp: Added.
1335         (WebCore::gcryptSign):
1336         (WebCore::gcryptVerify):
1337         (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
1338         (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
1339         * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
1340         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): Register the RSA-PSS algorithm.
1341
1342 2017-06-07  Ryosuke Niwa  <rniwa@webkit.org>
1343
1344         Merge TreeScopeAdopter into TreeScope
1345         https://bugs.webkit.org/show_bug.cgi?id=173040
1346
1347         Reviewed by Antti Koivisto.
1348
1349         Merged TreeScopeAdopter into TreeScope since it's used by TreeScope::adoptIfNeeded.
1350
1351         Most of code changes are for didMoveToNewDocument taking the new document as an argument,
1352         which is used by ShadowRoot::didMoveToNewDocument to update its document scope.
1353
1354         No new tests since there should be no behavioral change.
1355
1356         * CMakeLists.txt:
1357         * WebCore.xcodeproj/project.pbxproj:
1358         * dom/Element.cpp:
1359         (WebCore::Element::didMoveToNewDocument):
1360         * dom/Element.h:
1361         * dom/Node.cpp:
1362         (WebCore::Node::didMoveToNewDocument): Moved the code to moves the node lists and node iterators here
1363         from TreeScopeAdopter::moveNodeToNewDocument.
1364         * dom/Node.h:
1365         * dom/ShadowRoot.cpp:
1366         (WebCore::ShadowRoot::didMoveToNewDocument): Moved the code to update the document scope here
1367         from TreeScopeAdopter::moveNodeToNewDocument.
1368         * dom/ShadowRoot.h:
1369         * dom/TreeScope.cpp:
1370         (WebCore::TreeScope::adoptIfNeeded):
1371         (WebCore::TreeScope::moveTreeToNewScope): Moved from TreeScopeAdopter. Now takes the old tree scope and
1372         the new tree scope as arguments (they used to be members of TreeScopeAdopter). Also merged updateTreeScope
1373         into this function.
1374         (WebCore::TreeScope::ensureDidMoveToNewDocumentWasCalled): Moved from TreeScopeAdopter.
1375         (WebCore::TreeScope::moveNodeToNewDocument): Ditto. The code to adopt node lists and node iterators have
1376         been moved to Node::didMoveToNewDocument.
1377         (WebCore::TreeScope::moveShadowTreeToNewDocument): Moved from TreeScopeAdopter.
1378         * dom/TreeScope.h:
1379         (WebCore::TreeScope::ensureDidMoveToNewDocumentWasCalled):
1380         * dom/TreeScopeAdopter.cpp: Removed.
1381         * dom/TreeScopeAdopter.h: Removed.
1382         * html/HTMLFieldSetElement.cpp:
1383         (WebCore::HTMLFieldSetElement::didMoveToNewDocument):
1384         * html/HTMLFieldSetElement.h:
1385         * html/HTMLFormControlElement.cpp:
1386         (WebCore::HTMLFormControlElement::didMoveToNewDocument):
1387         * html/HTMLFormControlElement.h:
1388         * html/HTMLFormElement.cpp:
1389         (WebCore::HTMLFormElement::didMoveToNewDocument):
1390         * html/HTMLFormElement.h:
1391         * html/HTMLImageElement.cpp:
1392         (WebCore::HTMLImageElement::didMoveToNewDocument):
1393         * html/HTMLImageElement.h:
1394         * html/HTMLInputElement.cpp:
1395         (WebCore::HTMLInputElement::didMoveToNewDocument): Grouped related function calls on new/old documents.
1396         * html/HTMLInputElement.h:
1397         * html/HTMLMediaElement.cpp:
1398         (WebCore::HTMLMediaElement::didMoveToNewDocument):
1399         * html/HTMLMediaElement.h:
1400         * html/HTMLObjectElement.cpp:
1401         (WebCore::HTMLObjectElement::didMoveToNewDocument):
1402         * html/HTMLObjectElement.h:
1403         * html/HTMLPictureElement.cpp:
1404         (WebCore::HTMLPictureElement::didMoveToNewDocument):
1405         * html/HTMLPictureElement.h:
1406         * html/HTMLPlugInImageElement.cpp:
1407         (WebCore::HTMLPlugInImageElement::didMoveToNewDocument):
1408         * html/HTMLPlugInImageElement.h:
1409         * html/HTMLTemplateElement.cpp:
1410         (WebCore::HTMLTemplateElement::didMoveToNewDocument):
1411         * html/HTMLTemplateElement.h:
1412         * html/HTMLVideoElement.cpp:
1413         (WebCore::HTMLVideoElement::didMoveToNewDocument):
1414         * html/HTMLVideoElement.h:
1415         * html/ImageDocument.cpp:
1416         (WebCore::ImageDocumentElement::didMoveToNewDocument):
1417         * svg/SVGImageElement.cpp:
1418         (WebCore::SVGImageElement::didMoveToNewDocument):
1419         * svg/SVGImageElement.h:
1420         * svg/SVGSVGElement.cpp:
1421         (WebCore::SVGSVGElement::didMoveToNewDocument):
1422         * svg/SVGSVGElement.h:
1423
1424 2017-06-06  Ryosuke Niwa  <rniwa@webkit.org>
1425
1426         Use a dedicated node flag to identify a Document node
1427         https://bugs.webkit.org/show_bug.cgi?id=173037
1428
1429         Reviewed by Chris Dumez.
1430
1431         Use a Node flag to identify a Document node instead of checking this == document() which loads TreeScope.
1432
1433         * dom/Document.h:
1434         (WebCore::Node::isDocumentNode): Deleted.
1435         * dom/Node.h:
1436         (WebCore::Node::isDocumentNode):
1437
1438 2017-06-06  Dan Bernstein  <mitz@apple.com>
1439
1440         Fixed building with the macOS 10.13 Apple Internal SDK when targeting macOS 10.12.
1441
1442         * platform/spi/cocoa/PassKitSPI.h:
1443
1444 2017-06-06  Chris Dumez  <cdumez@apple.com>
1445
1446         Unreviewed, rolling out r214974.
1447
1448         Causes some tabs to start using a huge amount of CPU after 8
1449         minutes in the background
1450
1451         Reverted changeset:
1452
1453         "Make inactive web processes behave as though under memory
1454         pressure."
1455         https://bugs.webkit.org/show_bug.cgi?id=170042
1456         http://trac.webkit.org/changeset/214974
1457
1458 2017-06-06  Tim Horton  <timothy_horton@apple.com>
1459
1460         Crash trying to drag the entire text of a long book out of Mail compose view
1461         https://bugs.webkit.org/show_bug.cgi?id=173042
1462         <rdar://problem/32382059>
1463
1464         Reviewed by Simon Fraser.
1465
1466         Creating a TextIndicator that is hundreds of thousands of pixels tall
1467         is not a good idea. We introduced TextIndicatorOptionDoNotClipToVisibleRect
1468         so that (for example) an image that overhangs the edge of the page would
1469         contain the entire image, instead of just the visible fragment.
1470         Instead, rename this option to ExpandClipBeyondVisibleRect, and make it
1471         not unclip *entirely*, but expand the clip significantly (50% in each direction)
1472         beyond the bounds of the current visible rect. Also, make use of exposed
1473         area information for this clipping; otherwise, clients with very large views
1474         inside scrollable areas (like Mail) would still try to create large TextIndicators.
1475
1476         * page/TextIndicator.cpp:
1477         (WebCore::initializeIndicator):
1478         * page/TextIndicator.h:
1479
1480 2017-06-06  Chris Dumez  <cdumez@apple.com>
1481
1482         RELEASE_ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values)) hit in convertEnumerationToJS<WebCore::History::ScrollRestoration>()
1483         https://bugs.webkit.org/show_bug.cgi?id=173033
1484         <rdar://problem/32591099>
1485
1486         Reviewed by Simon Fraser.
1487
1488         History::scrollRestoration() was returning a bad value because HistoryItem::m_shouldRestoreScrollPosition
1489         was initialized from FrameState::shouldRestoreScrollPosition member, which was not initialized when
1490         restored from the legacy session restore API.
1491
1492         Tests: WebKit2.RestoreSessionStateContainingScrollRestoration* API tests.
1493
1494         * bindings/scripts/CodeGeneratorJS.pm:
1495         (GenerateEnumerationImplementationContent):
1496         Drop the RELEASE_ASSERT that was added to debug this and use the regular debug ASSERT.
1497
1498         * history/HistoryItem.cpp:
1499         (WebCore::HistoryItem::setShouldRestoreScrollPosition):
1500         Make sure we notify that the HistoryItem has changed when setShouldRestoreScrollPosition()
1501         is called.
1502
1503 2017-06-06  Darin Adler  <darin@apple.com>
1504
1505         Update to slightly stricter rules for custom element names from more recent standard draft
1506         https://bugs.webkit.org/show_bug.cgi?id=173019
1507
1508         Reviewed by Ryosuke Niwa.
1509
1510         * bindings/js/JSCustomElementRegistryCustom.cpp:
1511         (WebCore::validateCustomElementNameAndThrowIfNeeded): Add more error strings for various error cases.
1512
1513         * dom/Document.cpp:
1514         (WebCore::isPotentialCustomElementNameCharacter): Added. Implements the PCENChar production
1515         from the standard by listing all the ranges exactly as they appear in the standard.
1516         (WebCore::Document::validateCustomElementName): Added a check that the first character is
1517         a lowercase ASCII letter. Added a check that all characters are potential custom element
1518         name characters.
1519
1520         * dom/Document.h: Update the CustomElementNameValidationStatus with new values for
1521         the various new error cases.  Not sure that validateCustomElementName really belongs
1522         in the Document class in the first place. Also seems that the error strings could be
1523         in validateCustomElementName rather than in a separate bindings function, obviating
1524         the need for the enum.
1525
1526 2017-06-06  Yoav Weiss  <yoav@yoav.ws>
1527
1528         [preload] Conditional support for media preloading and align media `as` values.
1529         https://bugs.webkit.org/show_bug.cgi?id=172501
1530
1531         Reviewed by Dean Jackson.
1532
1533         As discussed at https://bugs.webkit.org/show_bug.cgi?id=171720#c11 media preloading may not work
1534         since the backend may not reuse such resources properly.
1535         This patch makes support for media preloading conditional on a setting, in order to avoid double downloads in these cases.
1536         It also aligns the media `as` values to the spec, and splitting them into "video" and "audio".
1537
1538         No new tests but related tests were modified to remove media preloading tests as the setting is off by default.
1539
1540         * loader/LinkLoader.cpp:
1541         (WebCore::LinkLoader::resourceTypeFromAsAttribute): Make handling of MediaResource conditional on setting. Align `as` values to spec.
1542         (WebCore::createLinkPreloadResourceClient): Make handling of MediaResource conditional on setting.
1543         (WebCore::LinkLoader::isSupportedType): Make handling of MediaResource conditional on setting.
1544         * page/RuntimeEnabledFeatures.h: Added a media preloading preference.
1545         (WebCore::RuntimeEnabledFeatures::setMediaPreloadingEnabled):
1546         (WebCore::RuntimeEnabledFeatures::mediaPreloadingEnabled):
1547         * page/Settings.in: Added a media preloading preference.
1548
1549 2017-06-06  Don Olmstead  <don.olmstead@am.sony.com>
1550
1551         [WebCore] Enable REQUEST_ANIMATION_FRAME_TIMER for all ports
1552         https://bugs.webkit.org/show_bug.cgi?id=172780
1553
1554         Reviewed by Alex Christensen.
1555
1556         No new tests. No change in behavior.
1557
1558         * dom/ScriptedAnimationController.cpp:
1559         (WebCore::ScriptedAnimationController::ScriptedAnimationController):
1560         (WebCore::ScriptedAnimationController::addThrottlingReason):
1561         (WebCore::ScriptedAnimationController::removeThrottlingReason):
1562         (WebCore::ScriptedAnimationController::isThrottled):
1563         (WebCore::ScriptedAnimationController::interval):
1564         (WebCore::ScriptedAnimationController::scheduleAnimation):
1565         (WebCore::ScriptedAnimationController::displayRefreshFired):
1566         * dom/ScriptedAnimationController.h:
1567         * loader/EmptyClients.h:
1568         * page/Chrome.cpp:
1569         (WebCore::Chrome::scheduleAnimation): Deleted.
1570         * page/Chrome.h:
1571         * page/ChromeClient.h:
1572         * platform/Curl.cmake: Added.
1573         * platform/ScrollAnimationSmooth.cpp:
1574         (WebCore::ScrollAnimationSmooth::ScrollAnimationSmooth):
1575         (WebCore::ScrollAnimationSmooth::stop):
1576         (WebCore::ScrollAnimationSmooth::animationTimerFired):
1577         (WebCore::ScrollAnimationSmooth::startNextTimer):
1578         (WebCore::ScrollAnimationSmooth::animationTimerActive):
1579         (WebCore::ScrollAnimationSmooth::serviceAnimation): Deleted.
1580         * platform/ScrollAnimationSmooth.h:
1581
1582 2017-06-06  Darin Adler  <darin@apple.com>
1583
1584         Cut down use of WTF_ARRAY_LENGTH
1585         https://bugs.webkit.org/show_bug.cgi?id=172997
1586
1587         Reviewed by Chris Dumez.
1588
1589         * contentextensions/NFAToDFA.cpp: Remove unused SetTransitions class.
1590
1591         * dom/Document.cpp:
1592         (WebCore::Document::~Document): Use modern for loop instead of WTF_ARRAY_LENGTH.
1593         * dom/make_names.pl:
1594         (printDefinitions): Ditto.
1595         (printFactoryCppFile): Ditto.
1596         (printWrapperFactoryCppFile): Ditto.
1597
1598         * platform/URL.cpp:
1599         (WebCore::portAllowed): Use std::is_sorted, std::begin, and std::end
1600         in sort assertion to greatly streamline it and eliminate use of WTF_ARRAY_LENGTH.
1601         Also allow the sort assertion to run every time; slightly optimizing debug builds
1602         was not worth having the code be messy.
1603
1604         * platform/URLParser.cpp:
1605         (WebCore::URLParser::appendNumberToASCIIBuffer): Use std::end instead of
1606         WTF_ARRAY_LENGTH.
1607
1608         * platform/graphics/FontCascade.cpp: Make fontFamiliesWithInvalidCharWidth be
1609         a constant array rather than a non-constant array to constant strings.
1610         (WebCore::FontCascade::hasValidAverageCharWidth): Streamline the hash table
1611         initialization to avoid heap allocation and use a modern for loop instead of
1612         WTF_ARRAY_LENGTH.
1613
1614         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1615         (WebCore::disableComponentsOnce): Use a modern for loop instead of WTF_ARRAY_LENGTH.
1616         * platform/network/CacheValidation.cpp:
1617         (WebCore::shouldUpdateHeaderAfterRevalidation): Ditto. Also use the
1618         startsWithIgnoringASCIICase function rather than the version that folds
1619         arbitrary Unicode case.
1620
1621         * platform/text/TextEncodingRegistry.cpp:
1622         (WebCore::pruneBlacklistedCodecs): Use modern for loops to make the code considerably
1623         easier to read and avoid WTF_ARRAY_LENGTH.
1624
1625         * platform/text/mac/LocaleMac.mm:
1626         (WebCore::LocaleMac::monthLabels): Use modern for loop instead of WTF_ARRAY_LENGTH.
1627         (WebCore::LocaleMac::shortMonthLabels): Ditto.
1628         * rendering/RenderCombineText.cpp:
1629         (WebCore::RenderCombineText::combineText): Ditto.
1630
1631 2017-06-06  Isaac Devine  <isaac@devinesystems.co.nz>
1632
1633         Allow FileReader to open files multiple times
1634
1635         If multiple file readers open files they are prevented by default due to
1636         Windows' file locking.
1637
1638         Allow FileReader to open multiple files for reading at the same time on wincairo
1639         https://bugs.webkit.org/show_bug.cgi?id=172632
1640
1641         Reviewed by Darin Adler.
1642
1643         * platform/win/FileSystemWin.cpp:
1644         (WebCore::openFile): Use the appropriate sharing options to allow multiple opens
1645
1646 2017-06-06  Beth Dakin  <bdakin@apple.com>
1647
1648         Netflix seeking quirk should also apply to Now Playing, and should always use the 
1649         livestream UI
1650         https://bugs.webkit.org/show_bug.cgi?id=173030
1651         -and corresponding-
1652         rdar://problem/32228660
1653
1654         Reviewed by Darin Adler.
1655
1656         This patch rolls out much of https://trac.webkit.org/changeset/217791/webkit in 
1657         favor of an approach that can be used to apply the quirk to Now Playing in 
1658         addition to Touch Bar. This patch also changes the UI in both Touch Bar and Now 
1659         Playing to match live stream UI, which means there is no playhead. This hopefully 
1660         makes it less confusing that taps on the timeline will have no effect. 
1661
1662         supportsSeeking() should return false for Netflix. That function needs to be 
1663         public now.
1664         * html/HTMLMediaElement.cpp:
1665         (WebCore::needsSeekingSupportQuirk):
1666         (WebCore::HTMLMediaElement::supportsSeeking):
1667         * html/HTMLMediaElement.h:
1668
1669         Here is where we get the desired result in Now Playing. Make sure the 
1670         currentSession supportsSeeking() before relying on the time and duration info for 
1671         the sake of Now Playing. 
1672         * platform/audio/mac/MediaSessionManagerMac.mm:
1673         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
1674
1675         We can roll out allowsTouchBarScrubbing() and rely on supportsSeeking().
1676         * platform/cocoa/WebPlaybackSessionModel.h:
1677         (WebCore::WebPlaybackSessionModelClient::mutedChanged):
1678         (WebCore::WebPlaybackSessionModelClient::allowsTouchBarScrubbingChanged): Deleted.
1679         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
1680         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
1681         (WebCore::WebPlaybackSessionModelMediaElement::updateForEventName):
1682
1683         And here is where we get the desired result for Touch Bar. Make sure the the media 
1684         element supportsSeeking() before relying on the duration. 
1685         (WebCore::WebPlaybackSessionModelMediaElement::duration):
1686
1687         We can roll out allowsTouchBarScrubbing() and rely on supportsSeeking().
1688         (WebCore::WebPlaybackSessionModelMediaElement::allowsTouchBarScrubbing): Deleted.
1689         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1690         * platform/mac/WebPlaybackControlsManager.h:
1691
1692         Currently the Touch Bar live stream UI lets you seek, which results in broken 
1693         behavior on real live streams and on Netflix. Prevent that by preventing scrubbing 
1694         for NaN and infinite durations.
1695         * platform/mac/WebPlaybackControlsManager.mm:
1696         (-[WebPlaybackControlsManager canBeginTouchBarScrubbing]):
1697
1698         We can roll out allowsTouchBarScrubbing() and rely on supportsSeeking().
1699         * platform/mac/WebPlaybackSessionInterfaceMac.h:
1700         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
1701         (WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
1702         (WebCore::WebPlaybackSessionInterfaceMac::allowsTouchBarScrubbingChanged): Deleted.
1703
1704 2017-06-06  Konstantin Tokarev  <annulen@yandex.ru>
1705
1706         Add missing <functional> includes
1707         https://bugs.webkit.org/show_bug.cgi?id=173017
1708
1709         Patch by Thiago Macieira <thiago.macieira@intel.com>
1710         Reviewed by Yusuke Suzuki.
1711
1712         This patch fixes compilation with GCC 7.
1713
1714         No new tests needed.
1715
1716         * css/CSSValue.h:
1717         * css/StyleSheetContents.h:
1718         * loader/NetscapePlugInStreamLoader.h:
1719         * loader/ResourceLoader.h:
1720
1721 2017-06-06  Konstantin Tokarev  <annulen@yandex.ru>
1722
1723         Fix compilation with !ENABLE(SVG_FONTS)
1724         https://bugs.webkit.org/show_bug.cgi?id=172731
1725
1726         Reviewed by Darin Adler.
1727
1728         No new tests needed.
1729
1730         * css/CSSFontFaceSource.cpp:
1731         (WebCore::CSSFontFaceSource::load):
1732
1733 2017-06-06  Zalan Bujtas  <zalan@apple.com>
1734
1735         Safari doesn't load newest The Order of the Stick comic.
1736         https://bugs.webkit.org/show_bug.cgi?id=172949
1737         <rdar://problem/32389730>
1738
1739         Reviewed by Antti Koivisto.
1740
1741         As part of the table layout, RenderTableSection::layoutRows calls the RenderTableCell's layout() directly
1742         (skipping the RenderTableRow parent). If during this call the RenderTableCell (or any of its descendant) marks the ancestor
1743         chain dirty, this dirty flag on the RenderTableRows will never be cleared and we'll end up early returning from RenderTableSection::paint.
1744         For certain type of float objects, we need to invalidate the line layout path during layout (and we mark the ancestors dirty).
1745         This patch takes a conservative approach and marks the ancestors dirty only when the renderer is not dirty yet, but
1746         as part of webkit.org/b/172947 we should revisit and validate whether the setNeedsLayout() is required at all.
1747
1748         Test: fast/table/floating-table-sibling-is-invisible.html
1749
1750         * rendering/RenderBlockFlow.cpp:
1751         (WebCore::RenderBlockFlow::invalidateLineLayoutPath):
1752
1753 2017-06-06  Emilio Cobos Álvarez  <ecobos@igalia.com>
1754
1755         [css-conditional] The one-string version of CSS.supports should be wrapped in implied parentheses.
1756         https://bugs.webkit.org/show_bug.cgi?id=172906
1757
1758         Reviewed by Darin Adler.
1759
1760         From https://drafts.csswg.org/css-conditional/#the-css-interface:
1761
1762         > When invoked with a single conditionText argument, it must return
1763         > true if conditionText, when either parsed and evaluated as a
1764         > supports_condition or parsed as a declaration, wrapped in implied
1765         > parentheses, and evaluated as a supports_condition, would return
1766         > true.
1767
1768         Note the "wrapped in implied parentheses" bit.
1769
1770         Gecko is fixing it in https://bugzil.la/1338486, and Blink in
1771         https://crbug.com/729403.
1772
1773         Tests: css3/supports-dom-api.html
1774                imported/w3c/web-platform-tests/cssom/CSS.html
1775
1776         * css/parser/CSSParser.cpp:
1777         (WebCore::CSSParser::parseSupportsCondition):
1778         * css/parser/CSSParserImpl.cpp:
1779         (WebCore::CSSParserImpl::consumeSupportsRule):
1780         * css/parser/CSSSupportsParser.cpp:
1781         (WebCore::CSSSupportsParser::supportsCondition):
1782         * css/parser/CSSSupportsParser.h:
1783
1784 2017-06-06  Joseph Pecoraro  <pecoraro@apple.com>
1785
1786         Move Resource Timing / User Timing from experimental features into main preferences
1787         https://bugs.webkit.org/show_bug.cgi?id=172950
1788
1789         Reviewed by Darin Adler.
1790
1791         * features.json:
1792         Graduate some features from In Development to Supported.
1793
1794 2017-06-06  Adrian Perez de Castro  <aperez@igalia.com>
1795
1796         [GTK][Wayland] Do not pass value of $DISPLAY to wl_display_connect()
1797         https://bugs.webkit.org/show_bug.cgi?id=172993
1798
1799         Reviewed by Žan Doberšek.
1800
1801         No new tests needed.
1802
1803         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
1804         (WebCore::PlatformDisplayWayland::create): Instead of using the "DISPLAY" environment variable (meant for X11),
1805         pass a null pointer to "wl_display_connect()". This function checks the value of the "WAYLAND_DISPLAY" environment
1806         variable itself and therefore we do not need to pass it ourselves.
1807
1808 2017-06-06  Antoine Quint  <graouts@apple.com>
1809
1810         Rebaseline and enable media/modern-media-controls/airplay-support
1811         https://bugs.webkit.org/show_bug.cgi?id=172980
1812
1813         Reviewed by Eric Carlson.
1814
1815         Fixing a small issue in the modern media controls code which would yield
1816         an error when manually creating a MediaController without a MediaControlsHost.
1817
1818         * Modules/modern-media-controls/media/media-controller.js:
1819         (MediaController.prototype.get isAudio):
1820
1821 2017-06-06  Antoine Quint  <graouts@apple.com>
1822
1823         Update modern media controls testing utilities
1824         https://bugs.webkit.org/show_bug.cgi?id=172976
1825         <rdar://problem/32588432>
1826
1827         Reviewed by Eric Carlson.
1828
1829         Stop logging an error when we're not able to load UI Strings since UI strings
1830         are not defined in the majority of modern-media-controls tests as we load the
1831         code directly from the modern-media-controls module and can't reach into the
1832         English.lproj directory, nor is it necessary.
1833
1834         * Modules/modern-media-controls/main.js:
1835         (UIString):
1836
1837 2017-06-06  Carlos Garcia Campos  <cgarcia@igalia.com>
1838
1839         [GStreamer] Use the same draw timer and mutex when AC disabled or building without OpenGL
1840         https://bugs.webkit.org/show_bug.cgi?id=172923
1841
1842         Reviewed by Michael Catanzaro.
1843
1844         We have two different paths to do the same. When building without OpenGL, the VideoRenderRequestScheduler has
1845         its own timer and we need to add ifdefs to handle that. But when building with OpenGL we still support
1846         non-accelerated rendering that does the same than the VideoRenderRequestScheduler timer, but using the media
1847         player timer instead. We can simplify the code and remove more ifdefs by using the media player timer and mutex
1848         in all cases for non-accelerated rendering.
1849
1850         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1851         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
1852         (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
1853         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
1854         (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
1855         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1856         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
1857         (VideoRenderRequestScheduler::start):
1858         (VideoRenderRequestScheduler::stop):
1859         (VideoRenderRequestScheduler::requestRender):
1860         (VideoRenderRequestScheduler::VideoRenderRequestScheduler): Deleted.
1861         (VideoRenderRequestScheduler::render): Deleted.
1862
1863 2017-06-05  Antoine Quint  <graouts@apple.com>
1864
1865         Update media controls to match latest design specs
1866         https://bugs.webkit.org/show_bug.cgi?id=172932
1867
1868         Reviewed by Dean Jackson.
1869
1870         The media controls specs have changed and we now implement them. The main controls bar now
1871         appears to be floating, with a rounded corners and a margin around it. Some of the controls
1872         it used to contain now may appear outside of it. Specifically, the fullscreen and
1873         picture-in-picture buttons now are displayed in a dedicated controls bar in the top-left
1874         corner and the mute button, on iOS (where we don't support changing the volume when inline),
1875         is displayed in the top right corner.
1876
1877         Another small UI improvement is that we display an activity indicator when we are waiting
1878         for data to initiate or resume playback instead of showing the elapsed time label. We also
1879         make displaying the scrubber more important than displaying other controls, except for the
1880         play/pause button, when width becomes scarce. Finally, we no longer use a speci layer type
1881         for the controls bar backgrounds, we now use the same "backdrop-filter" and tint overlay
1882         on both macOS and iOS.
1883
1884         Since this work had previously been done through WebKitAdditions, we remove the specific
1885         build phase code that we added for this purpose and are now only ever looking for media
1886         controls code in the WebCore source tree.
1887
1888         * Modules/modern-media-controls/controls/activity-indicator.css: Added.
1889         (.activity-indicator):
1890         (.activity-indicator > div):
1891         (.activity-indicator > .ne):
1892         (.activity-indicator > .e):
1893         (.activity-indicator > .se):
1894         (.activity-indicator > .s):
1895         (.activity-indicator > .sw):
1896         (.activity-indicator > .w):
1897         (.activity-indicator > .nw):
1898         (@keyframes activity-indicator-pulse):
1899         (to):
1900         * Modules/modern-media-controls/controls/airplay-button.js:
1901         * Modules/modern-media-controls/controls/auto-hide-controller.js: Added.
1902         (AutoHideController):
1903         (AutoHideController.prototype.get fadesWhileIdle):
1904         (AutoHideController.prototype.set fadesWhileIdle):
1905         (AutoHideController.prototype.handleEvent):
1906         (AutoHideController.prototype.gestureRecognizerStateDidChange):
1907         (AutoHideController.prototype.mediaControlsFadedStateDidChange):
1908         (AutoHideController.prototype.mediaControlsBecameInvisible):
1909         (AutoHideController.prototype._cancelNonEnforcedAutoHideTimer):
1910         (AutoHideController.prototype._cancelAutoHideTimer):
1911         (AutoHideController.prototype._resetAutoHideTimer):
1912         (AutoHideController.prototype._autoHideTimerFired):
1913         * Modules/modern-media-controls/controls/background-click-delegate-notifier.js: Added.
1914         (BackgroundClickDelegateNotifier):
1915         (BackgroundClickDelegateNotifier.prototype.handleEvent):
1916         * Modules/modern-media-controls/controls/background-tint.css:
1917         (.background-tint,):
1918         (.background-tint > .blur):
1919         (.background-tint > .tint):
1920         * Modules/modern-media-controls/controls/button.css:
1921         (button):
1922         (button > picture):
1923         (button.skip-back > picture,):
1924         (button.on > picture):
1925         (button:active > picture):
1926         (button.corner):
1927         (button.center,):
1928         (button.center):
1929         (button.small-center):
1930         (button.center > .background-tint,):
1931         (button.center > picture,):
1932         (button.center:active > picture,):
1933         * Modules/modern-media-controls/controls/button.js:
1934         (Button.prototype.get iconName):
1935         (Button.prototype.set iconName):
1936         (Button.prototype.get on):
1937         (Button.prototype.set on):
1938         (Button.prototype.get style):
1939         (Button.prototype.set style):
1940         (Button.prototype.get scaleFactor):
1941         (Button.prototype.set scaleFactor):
1942         (Button.prototype.handleEvent):
1943         (Button.prototype.commit):
1944         (Button.prototype._loadImage):
1945         (Button.prototype._imageSourceDidLoad):
1946         (Button.prototype._updateImage):
1947         (Button.prototype._updateImageMetrics):
1948         (Button):
1949         * Modules/modern-media-controls/controls/buttons-container.css:
1950         (.buttons-container):
1951         (.ios .buttons-container button):
1952         * Modules/modern-media-controls/controls/buttons-container.js:
1953         * Modules/modern-media-controls/controls/controls-bar.css:
1954         (.controls-bar):
1955         (.controls-bar.faded): Deleted.
1956         * Modules/modern-media-controls/controls/controls-bar.js:
1957         (ControlsBar.prototype.get children):
1958         (ControlsBar.prototype.set children):
1959         (ControlsBar.prototype.commitProperty):
1960         (ControlsBar.prototype.get userInteractionEnabled): Deleted.
1961         (ControlsBar.prototype.set userInteractionEnabled): Deleted.
1962         (ControlsBar.prototype.get fadesWhileIdle): Deleted.
1963         (ControlsBar.prototype.set fadesWhileIdle): Deleted.
1964         (ControlsBar.prototype.get visible): Deleted.
1965         (ControlsBar.prototype.set visible): Deleted.
1966         (ControlsBar.prototype.get faded): Deleted.
1967         (ControlsBar.prototype.set faded): Deleted.
1968         (ControlsBar.prototype.handleEvent): Deleted.
1969         (ControlsBar.prototype.gestureRecognizerStateDidChange): Deleted.
1970         (ControlsBar.prototype._cancelNonEnforcedAutoHideTimer): Deleted.
1971         (ControlsBar.prototype._cancelAutoHideTimer): Deleted.
1972         (ControlsBar.prototype._resetAutoHideTimer): Deleted.
1973         (ControlsBar.prototype._autoHideTimerFired): Deleted.
1974         * Modules/modern-media-controls/controls/fullscreen-button.js:
1975         * Modules/modern-media-controls/controls/icon-button.css: Removed.
1976         * Modules/modern-media-controls/controls/icon-button.js: Removed.
1977         * Modules/modern-media-controls/controls/icon-service.js:
1978         (const.iconService.new.IconService.prototype.imageForIconAndLayoutTraits):
1979         (const.iconService.new.IconService.prototype._fileNameAndPlatformForIconAndLayoutTraits):
1980         (const.iconService.new.IconService):
1981         (const.iconService.new.IconService.prototype.imageForIconNameAndLayoutTraits): Deleted.
1982         (const.iconService.new.IconService.prototype._fileNameAndPlatformForIconNameAndLayoutTraits): Deleted.
1983         * Modules/modern-media-controls/controls/inline-layout-support.js: Removed.
1984         * Modules/modern-media-controls/controls/inline-media-controls.css: Added.
1985         (.media-controls.inline > .controls-bar):
1986         (.media-controls.inline > .controls-bar.top-left):
1987         (.media-controls.inline.audio > .controls-bar):
1988         (.media-controls.inline > .controls-bar > *):
1989         (.media-controls.inline > button.mute):
1990         (.media-controls.inline > button.play-pause.corner):
1991         (.media-controls.inline.audio > button.play-pause.corner):
1992         (.media-controls.inline > .controls-bar button):
1993         (.media-controls.inline button.start.center > picture,):
1994         (.media-controls.inline button.start.small-center > picture,):
1995         (.media-controls.inline .time-control,):
1996         * Modules/modern-media-controls/controls/inline-media-controls.js: Added.
1997         (InlineMediaControls):
1998         (InlineMediaControls.prototype.set shouldUseAudioLayout):
1999         (InlineMediaControls.prototype.set shouldUseSingleBarLayout):
2000         (InlineMediaControls.prototype.get showsStartButton):
2001         (InlineMediaControls.prototype.set showsStartButton):
2002         (InlineMediaControls.prototype.showPlacard):
2003         (InlineMediaControls.prototype.hidePlacard):
2004         (InlineMediaControls.prototype.layout):
2005         (InlineMediaControls.prototype.commitProperty):
2006         (InlineMediaControls.prototype.get preferredMuteButtonStyle):
2007         (InlineMediaControls.prototype._topLeftContainerButtons):
2008         (InlineMediaControls.prototype._leftContainerButtons):
2009         (InlineMediaControls.prototype._rightContainerButtons):
2010         (InlineMediaControls.prototype._droppableButtons):
2011         * Modules/modern-media-controls/controls/ios-inline-media-controls.css: Removed.
2012         * Modules/modern-media-controls/controls/ios-inline-media-controls.js:
2013         (IOSInlineMediaControls.prototype.get showsStartButton):
2014         (IOSInlineMediaControls.prototype.set showsStartButton):
2015         (IOSInlineMediaControls.prototype.gestureRecognizerStateDidChange):
2016         (IOSInlineMediaControls.prototype._pinchGestureRecognizerStateDidChange):
2017         (IOSInlineMediaControls.prototype._tapGestureRecognizerStateDidChange):
2018         (IOSInlineMediaControls):
2019         (IOSInlineMediaControls.prototype.layout): Deleted.
2020         (IOSInlineMediaControls.prototype.layoutTraitsDidChange): Deleted.
2021         * Modules/modern-media-controls/controls/layout-item.js:
2022         * Modules/modern-media-controls/controls/layout-node.js:
2023         (LayoutNode.prototype.commitProperty):
2024         * Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css: Removed.
2025         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
2026         (.media-controls.mac.fullscreen .buttons-container.left):
2027         (.media-controls.mac.fullscreen .buttons-container.center):
2028         (.media-controls.mac.fullscreen .time-control):
2029         (.media-controls.mac.fullscreen > .controls-bar .status-label):
2030         (.media-controls.mac.fullscreen > .controls-bar > .background-tint > div): Deleted.
2031         (.media-controls.mac.fullscreen .volume.slider): Deleted.
2032         (.media-controls.mac.fullscreen button.volume-down): Deleted.
2033         (.media-controls.mac.fullscreen button.volume-up): Deleted.
2034         (.media-controls.mac.fullscreen button.rewind): Deleted.
2035         (.media-controls.mac.fullscreen button.play-pause): Deleted.
2036         (.media-controls.mac.fullscreen button.forward): Deleted.
2037         (.media-controls.mac.fullscreen .time-label): Deleted.
2038         (.media-controls.mac.fullscreen .scrubber): Deleted.
2039         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
2040         (MacOSFullscreenMediaControls.prototype.handleEvent):
2041         (MacOSFullscreenMediaControls.prototype.layout):
2042         (MacOSFullscreenMediaControls.prototype._handleMousedown):
2043         (MacOSFullscreenMediaControls.prototype._handleMousemove):
2044         * Modules/modern-media-controls/controls/macos-inline-media-controls.css:
2045         (.media-controls.mac.inline .volume-slider-container):
2046         (.media-controls.mac.inline.audio .volume-slider-container):
2047         (.media-controls.mac.inline .volume-slider-container > .background-tint):
2048         (.media-controls.mac.inline .volume-slider-container > .background-tint > div):
2049         (.media-controls.mac.inline .volume-slider-container > .slider):
2050         (.media-controls.mac.inline > .controls-bar): Deleted.
2051         (.media-controls.mac.inline > .controls-bar > *): Deleted.
2052         (.media-controls.mac.inline > button.start > div): Deleted.
2053         (.media-controls.mac.inline > .controls-bar button): Deleted.
2054         (.media-controls.mac.inline button.play-pause): Deleted.
2055         (.media-controls.mac.inline button.skip-back): Deleted.
2056         (.media-controls.mac.inline .scrubber.slider): Deleted.
2057         (.media-controls.mac.inline button.mute): Deleted.
2058         (.media-controls.mac.inline button.airplay): Deleted.
2059         (.media-controls.mac.inline button.pip): Deleted.
2060         (.media-controls.mac.inline button.tracks): Deleted.
2061         (.media-controls.mac.inline button.fullscreen): Deleted.
2062         (.media-controls.mac.inline .time-label,): Deleted.
2063         (.media-controls.mac.inline .volume.slider): Deleted.
2064         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
2065         (MacOSInlineMediaControls.prototype.layout):
2066         (MacOSInlineMediaControls.prototype.get preferredMuteButtonStyle):
2067         (MacOSInlineMediaControls.prototype.handleEvent):
2068         (MacOSInlineMediaControls.prototype.layoutTraitsDidChange): Deleted.
2069         * Modules/modern-media-controls/controls/macos-media-controls.js: Removed.
2070         * Modules/modern-media-controls/controls/media-controls.css:
2071         (:host(audio)):
2072         (*):
2073         (:host(audio), *):
2074         (.media-controls-container):
2075         (.media-controls):
2076         (.media-controls > *):
2077         (.media-controls.shows-tracks-panel > .controls-bar,):
2078         (.media-controls.faded > *:not(.placard)):
2079         (.media-controls .time-label,):
2080         * Modules/modern-media-controls/controls/media-controls.js:
2081         (MediaControls.prototype.get visible):
2082         (MediaControls.prototype.set visible):
2083         (MediaControls.prototype.get faded):
2084         (MediaControls.prototype.set faded):
2085         (MediaControls.prototype.showTracksPanel):
2086         (MediaControls.prototype.hideTracksPanel):
2087         (MediaControls.prototype.isPointInControls):
2088         (MediaControls.prototype.handleEvent):
2089         (MediaControls.prototype.commitProperty):
2090         (MediaControls.prototype.get layoutTraits): Deleted.
2091         (MediaControls.prototype.set layoutTraits): Deleted.
2092         (MediaControls.prototype.get showsStartButton): Deleted.
2093         (MediaControls.prototype.set showsStartButton): Deleted.
2094         (MediaControls.prototype.get placard): Deleted.
2095         (MediaControls.prototype.get showsPlacard): Deleted.
2096         (MediaControls.prototype.showPlacard): Deleted.
2097         (MediaControls.prototype.hidePlacard): Deleted.
2098         (MediaControls.prototype.controlsBarVisibilityDidChange): Deleted.
2099         (MediaControls.prototype.controlsBarFadedStateDidChange): Deleted.
2100         (MediaControls.prototype.layoutTraitsDidChange): Deleted.
2101         (MediaControls.prototype.layout): Deleted.
2102         (MediaControls.prototype._invalidateChildren): Deleted.
2103         * Modules/modern-media-controls/controls/media-document.css:
2104         (:host(.media-document)):
2105         (:host(.media-document.audio.mac)):
2106         * Modules/modern-media-controls/controls/mute-button.js:
2107         * Modules/modern-media-controls/controls/pip-button.js:
2108         * Modules/modern-media-controls/controls/placard.css:
2109         (.placard):
2110         (.placard .container):
2111         (.placard button):
2112         (.placard button > picture):
2113         (.placard .icon): Deleted.
2114         * Modules/modern-media-controls/controls/placard.js:
2115         (Placard.):
2116         (Placard.prototype.layout):
2117         * Modules/modern-media-controls/controls/play-pause-button.js:
2118         (PlayPauseButton):
2119         (PlayPauseButton.prototype.commit):
2120         * Modules/modern-media-controls/controls/scheduler.js:
2121         (const.scheduler.new.prototype.scheduleLayout):
2122         (const.scheduler.new.prototype.unscheduleLayout):
2123         (const.scheduler.new.prototype._requestFrameIfNeeded):
2124         (const.scheduler.new.prototype._frameDidFire):
2125         (const.scheduler.new.prototype._layout):
2126         * Modules/modern-media-controls/controls/scrubber.js: Removed.
2127         * Modules/modern-media-controls/controls/seek-button.js:
2128         * Modules/modern-media-controls/controls/skip-back-button.js:
2129         * Modules/modern-media-controls/controls/skip-forward-button.js: Added.
2130         (SkipForwardButton):
2131         * Modules/modern-media-controls/controls/slider.css:
2132         (.slider):
2133         (.slider > .custom-slider,):
2134         (.slider > .custom-slider):
2135         (.slider > .custom-slider > *):
2136         (.slider > .custom-slider > .fill):
2137         (.slider > .custom-slider > .track):
2138         (.slider > .custom-slider > .primary):
2139         (.slider > .custom-slider > .secondary):
2140         (.slider > .custom-slider > .knob):
2141         (.slider > input):
2142         (.slider > input::-webkit-slider-thumb):
2143         (.slider.disabled > input,):
2144         (.ios .slider > input):
2145         (.ios .slider > input::-webkit-slider-runnable-track):
2146         (.ios .slider > input::-webkit-slider-thumb):
2147         (.slider > canvas,): Deleted.
2148         (.slider > canvas): Deleted.
2149         * Modules/modern-media-controls/controls/slider.js:
2150         (Slider.prototype.set inputAccessibleLabel):
2151         (Slider.prototype.get disabled):
2152         (Slider.prototype.set disabled):
2153         (Slider.prototype.get secondaryValue):
2154         (Slider.prototype.set secondaryValue):
2155         (Slider.prototype._formatTime):
2156         (Slider.prototype.commitProperty):
2157         (Slider.prototype.commit):
2158         (Slider.prototype.draw): Deleted.
2159         (addRoundedRect): Deleted.
2160         * Modules/modern-media-controls/controls/start-button.css: Removed.
2161         * Modules/modern-media-controls/controls/start-button.js: Removed.
2162         * Modules/modern-media-controls/controls/status-label.css:
2163         (.status-label):
2164         * Modules/modern-media-controls/controls/status-label.js:
2165         (StatusLabel.prototype.get enabled):
2166         (StatusLabel.prototype.set enabled): Deleted.
2167         * Modules/modern-media-controls/controls/text-tracks.css:
2168         (video::-webkit-media-text-track-container):
2169         (video::-webkit-media-text-track-container.visible-controls-bar):
2170         (video::-webkit-media-text-track-container.visible-controls-bar.compact-controls-bar): Deleted.
2171         * Modules/modern-media-controls/controls/time-control.js:
2172         (TimeControl.prototype.set duration):
2173         (TimeControl.prototype.set currentTime):
2174         (TimeControl.prototype.get loading):
2175         (TimeControl.prototype.set loading):
2176         (TimeControl.prototype.get minimumWidth):
2177         (TimeControl.prototype.get idealMinimumWidth):
2178         (TimeControl.prototype.layout):
2179         (TimeControl.prototype._performIdealLayout):
2180         (TimeControl.prototype.get useSixDigitsForTimeLabels): Deleted.
2181         (TimeControl.prototype.set useSixDigitsForTimeLabels): Deleted.
2182         (TimeControl.prototype.get isSufficientlyWide): Deleted.
2183         * Modules/modern-media-controls/controls/time-label.css:
2184         (.time-label):
2185         * Modules/modern-media-controls/controls/time-label.js:
2186         (TimeLabel.prototype.setValueWithNumberOfDigits):
2187         (TimeLabel.prototype.commitProperty):
2188         (TimeLabel.prototype._formattedTime):
2189         (doubleDigits):
2190         (TimeLabel.prototype.set value): Deleted.
2191         * Modules/modern-media-controls/controls/tracks-button.js:
2192         * Modules/modern-media-controls/controls/tracks-panel.css:
2193         (.tracks-panel > .scrollable-container):
2194         (.tracks-panel section):
2195         (.tracks-panel section > h3):
2196         (.tracks-panel > .background-tint > div,): Deleted.
2197         * Modules/modern-media-controls/controls/volume-down-button.js:
2198         * Modules/modern-media-controls/controls/volume-slider.css: Removed.
2199         * Modules/modern-media-controls/controls/volume-slider.js: Removed.
2200         * Modules/modern-media-controls/controls/volume-up-button.js:
2201         * Modules/modern-media-controls/gesture-recognizers/gesture-recognizer.js:
2202         (GestureRecognizer.prototype.gestureBegan):
2203         (GestureRecognizer.prototype._removeTrackingListeners):
2204         * Modules/modern-media-controls/gesture-recognizers/tap.js:
2205         (TapGestureRecognizer.prototype.touchesMoved):
2206         * Modules/modern-media-controls/images/iOS/Airplay.svg: Added.
2207         * Modules/modern-media-controls/images/iOS/EnterFullscreen.svg: Added.
2208         * Modules/modern-media-controls/images/iOS/MediaSelector.svg: Added.
2209         * Modules/modern-media-controls/images/iOS/MiniPipIn.svg: Added.
2210         * Modules/modern-media-controls/images/iOS/Mute.svg: Added.
2211         * Modules/modern-media-controls/images/iOS/Pause.svg: Added.
2212         * Modules/modern-media-controls/images/iOS/PipIn.svg: Added.
2213         * Modules/modern-media-controls/images/iOS/Play.svg: Added.
2214         * Modules/modern-media-controls/images/iOS/SkipBack15.svg: Added.
2215         * Modules/modern-media-controls/images/iOS/SkipForward15.svg: Added.
2216         * Modules/modern-media-controls/images/iOS/VolumeHi.svg: Added.
2217         * Modules/modern-media-controls/images/iOS/airplay@1x.png: Removed.
2218         * Modules/modern-media-controls/images/iOS/airplay@2x.png: Removed.
2219         * Modules/modern-media-controls/images/iOS/enter-fullscreen@1x.png: Removed.
2220         * Modules/modern-media-controls/images/iOS/enter-fullscreen@2x.png: Removed.
2221         * Modules/modern-media-controls/images/iOS/enter-fullscreen@3x.png: Removed.
2222         * Modules/modern-media-controls/images/iOS/interval-skip-back@1x.png: Removed.
2223         * Modules/modern-media-controls/images/iOS/interval-skip-back@2x.png: Removed.
2224         * Modules/modern-media-controls/images/iOS/interval-skip-back@3x.png: Removed.
2225         * Modules/modern-media-controls/images/iOS/pause@1x.png: Removed.
2226         * Modules/modern-media-controls/images/iOS/pause@2x.png: Removed.
2227         * Modules/modern-media-controls/images/iOS/pause@3x.png: Removed.
2228         * Modules/modern-media-controls/images/iOS/pip-in@1x.png: Removed.
2229         * Modules/modern-media-controls/images/iOS/pip-in@2x.png: Removed.
2230         * Modules/modern-media-controls/images/iOS/pip-in@3x.png: Removed.
2231         * Modules/modern-media-controls/images/iOS/play@1x.png: Removed.
2232         * Modules/modern-media-controls/images/iOS/play@2x.png: Removed.
2233         * Modules/modern-media-controls/images/iOS/play@3x.png: Removed.
2234         * Modules/modern-media-controls/images/iOS/slider-thumb@2x.png: Removed.
2235         * Modules/modern-media-controls/images/iOS/start@1x.png: Removed.
2236         * Modules/modern-media-controls/images/iOS/start@2x.png: Removed.
2237         * Modules/modern-media-controls/images/iOS/start@3x.png: Removed.
2238         * Modules/modern-media-controls/images/macOS/Airplay-fullscreen.svg: Added.
2239         * Modules/modern-media-controls/images/macOS/Airplay.svg: Added.
2240         * Modules/modern-media-controls/images/macOS/EnterFullscreen.svg: Added.
2241         * Modules/modern-media-controls/images/macOS/ExitFullscreen.svg: Added.
2242         * Modules/modern-media-controls/images/macOS/Forward.svg: Added.
2243         * Modules/modern-media-controls/images/macOS/MediaSelector-fullscreen.svg: Added.
2244         * Modules/modern-media-controls/images/macOS/MediaSelector.svg: Added.
2245         * Modules/modern-media-controls/images/macOS/Mute.svg: Added.
2246         * Modules/modern-media-controls/images/macOS/Pause.svg: Added.
2247         * Modules/modern-media-controls/images/macOS/PipIn-fullscreen.svg: Added.
2248         * Modules/modern-media-controls/images/macOS/PipIn.svg: Added.
2249         * Modules/modern-media-controls/images/macOS/Play.svg: Added.
2250         * Modules/modern-media-controls/images/macOS/Rewind.svg: Added.
2251         * Modules/modern-media-controls/images/macOS/SkipBack15.svg: Added.
2252         * Modules/modern-media-controls/images/macOS/SkipForward15.svg: Added.
2253         * Modules/modern-media-controls/images/macOS/VolumeHi.svg: Added.
2254         * Modules/modern-media-controls/images/macOS/VolumeLo.svg: Added.
2255         * Modules/modern-media-controls/images/macOS/airplay-compact@1x.png: Removed.
2256         * Modules/modern-media-controls/images/macOS/airplay-compact@2x.png: Removed.
2257         * Modules/modern-media-controls/images/macOS/airplay-fullscreen@1x.png: Removed.
2258         * Modules/modern-media-controls/images/macOS/airplay-fullscreen@2x.png: Removed.
2259         * Modules/modern-media-controls/images/macOS/airplay@1x.png: Removed.
2260         * Modules/modern-media-controls/images/macOS/airplay@2x.png: Removed.
2261         * Modules/modern-media-controls/images/macOS/enter-fullscreen-compact@1x.png: Removed.
2262         * Modules/modern-media-controls/images/macOS/enter-fullscreen-compact@2x.png: Removed.
2263         * Modules/modern-media-controls/images/macOS/enter-fullscreen@1x.png: Removed.
2264         * Modules/modern-media-controls/images/macOS/enter-fullscreen@2x.png: Removed.
2265         * Modules/modern-media-controls/images/macOS/exit-fullscreen@1x.png: Removed.
2266         * Modules/modern-media-controls/images/macOS/exit-fullscreen@2x.png: Removed.
2267         * Modules/modern-media-controls/images/macOS/forward@1x.png: Removed.
2268         * Modules/modern-media-controls/images/macOS/forward@2x.png: Removed.
2269         * Modules/modern-media-controls/images/macOS/interval-skip-back-compact@1x.png: Removed.
2270         * Modules/modern-media-controls/images/macOS/interval-skip-back-compact@2x.png: Removed.
2271         * Modules/modern-media-controls/images/macOS/interval-skip-back@1x.png: Removed.
2272         * Modules/modern-media-controls/images/macOS/interval-skip-back@2x.png: Removed.
2273         * Modules/modern-media-controls/images/macOS/media-selection-compact@1x.png: Removed.
2274         * Modules/modern-media-controls/images/macOS/media-selection-compact@2x.png: Removed.
2275         * Modules/modern-media-controls/images/macOS/media-selection-fullscreen@1x.png: Removed.
2276         * Modules/modern-media-controls/images/macOS/media-selection-fullscreen@2x.png: Removed.
2277         * Modules/modern-media-controls/images/macOS/media-selection@1x.png: Removed.
2278         * Modules/modern-media-controls/images/macOS/media-selection@2x.png: Removed.
2279         * Modules/modern-media-controls/images/macOS/pause-compact@1x.png: Removed.
2280         * Modules/modern-media-controls/images/macOS/pause-compact@2x.png: Removed.
2281         * Modules/modern-media-controls/images/macOS/pause-fullscreen@1x.png: Removed.
2282         * Modules/modern-media-controls/images/macOS/pause-fullscreen@2x.png: Removed.
2283         * Modules/modern-media-controls/images/macOS/pause@1x.png: Removed.
2284         * Modules/modern-media-controls/images/macOS/pause@2x.png: Removed.
2285         * Modules/modern-media-controls/images/macOS/pip-in-compact@1x.png: Removed.
2286         * Modules/modern-media-controls/images/macOS/pip-in-compact@2x.png: Removed.
2287         * Modules/modern-media-controls/images/macOS/pip-in-fullscreen@1x.png: Removed.
2288         * Modules/modern-media-controls/images/macOS/pip-in-fullscreen@2x.png: Removed.
2289         * Modules/modern-media-controls/images/macOS/pip-in@1x.png: Removed.
2290         * Modules/modern-media-controls/images/macOS/pip-in@2x.png: Removed.
2291         * Modules/modern-media-controls/images/macOS/play-compact@1x.png: Removed.
2292         * Modules/modern-media-controls/images/macOS/play-compact@2x.png: Removed.
2293         * Modules/modern-media-controls/images/macOS/play-fullscreen@1x.png: Removed.
2294         * Modules/modern-media-controls/images/macOS/play-fullscreen@2x.png: Removed.
2295         * Modules/modern-media-controls/images/macOS/play@1x.png: Removed.
2296         * Modules/modern-media-controls/images/macOS/play@2x.png: Removed.
2297         * Modules/modern-media-controls/images/macOS/rewind@1x.png: Removed.
2298         * Modules/modern-media-controls/images/macOS/rewind@2x.png: Removed.
2299         * Modules/modern-media-controls/images/macOS/scale-to-fill@1x.png: Removed.
2300         * Modules/modern-media-controls/images/macOS/scale-to-fill@2x.png: Removed.
2301         * Modules/modern-media-controls/images/macOS/scale-to-fit@1x.png: Removed.
2302         * Modules/modern-media-controls/images/macOS/scale-to-fit@2x.png: Removed.
2303         * Modules/modern-media-controls/images/macOS/start@1x.png: Removed.
2304         * Modules/modern-media-controls/images/macOS/start@2x.png: Removed.
2305         * Modules/modern-media-controls/images/macOS/volume-compact@1x.png: Removed.
2306         * Modules/modern-media-controls/images/macOS/volume-compact@2x.png: Removed.
2307         * Modules/modern-media-controls/images/macOS/volume-down-fullscreen@1x.png: Removed.
2308         * Modules/modern-media-controls/images/macOS/volume-down-fullscreen@2x.png: Removed.
2309         * Modules/modern-media-controls/images/macOS/volume-mute-compact@1x.png: Removed.
2310         * Modules/modern-media-controls/images/macOS/volume-mute-compact@2x.png: Removed.
2311         * Modules/modern-media-controls/images/macOS/volume-mute@1x.png: Removed.
2312         * Modules/modern-media-controls/images/macOS/volume-mute@2x.png: Removed.
2313         * Modules/modern-media-controls/images/macOS/volume-up-fullscreen@1x.png: Removed.
2314         * Modules/modern-media-controls/images/macOS/volume-up-fullscreen@2x.png: Removed.
2315         * Modules/modern-media-controls/images/macOS/volume@1x.png: Removed.
2316         * Modules/modern-media-controls/images/macOS/volume@2x.png: Removed.
2317         * Modules/modern-media-controls/js-files:
2318         * Modules/modern-media-controls/main.js:
2319         (UIString):
2320         (formatTimeByUnit):
2321         * Modules/modern-media-controls/media/audio-support.js: Added.
2322         (AudioSupport.prototype.get control):
2323         (AudioSupport.prototype.get mediaEvents):
2324         (AudioSupport.prototype.get tracksToMonitor):
2325         (AudioSupport.prototype.syncControl):
2326         (AudioSupport):
2327         * Modules/modern-media-controls/media/controls-visibility-support.js:
2328         (ControlsVisibilitySupport.prototype._updateControls):
2329         (ControlsVisibilitySupport):
2330         * Modules/modern-media-controls/media/fullscreen-support.js:
2331         (FullscreenSupport.prototype.buttonWasPressed):
2332         (FullscreenSupport.prototype.syncControl):
2333         (FullscreenSupport):
2334         (FullscreenSupport.prototype.iOSInlineMediaControlsRecognizedPinchInGesture): Deleted.
2335         * Modules/modern-media-controls/media/media-controller.js:
2336         (MediaController):
2337         (MediaController.prototype.get isAudio):
2338         (MediaController.prototype.get isYouTubeEmbedWithTitle):
2339         (MediaController.prototype.get isFullscreen):
2340         (MediaController.prototype.get layoutTraits):
2341         (MediaController.prototype.iOSInlineMediaControlsRecognizedTapGesture):
2342         (MediaController.prototype.iOSInlineMediaControlsRecognizedPinchInGesture):
2343         (MediaController.prototype._updateControlsIfNeeded):
2344         (MediaController.prototype._updateTextTracksClassList):
2345         (MediaController.prototype.controlsBarFadedStateDidChange): Deleted.
2346         * Modules/modern-media-controls/media/media-document-controller.js:
2347         (MediaDocumentController.prototype._mediaDocumentHasMetadata):
2348         * Modules/modern-media-controls/media/placard-support.js:
2349         (PlacardSupport.prototype._updatePlacard):
2350         (PlacardSupport):
2351         * Modules/modern-media-controls/media/scrubbing-support.js:
2352         (ScrubbingSupport.prototype.get mediaEvents):
2353         (ScrubbingSupport.prototype.syncControl):
2354         (ScrubbingSupport):
2355         * Modules/modern-media-controls/media/skip-back-support.js:
2356         * Modules/modern-media-controls/media/skip-forward-support.js: Added.
2357         (SkipForwardSupport.prototype.get control):
2358         (SkipForwardSupport.prototype.get mediaEvents):
2359         (SkipForwardSupport.prototype.buttonWasPressed):
2360         (SkipForwardSupport.prototype.syncControl):
2361         (SkipForwardSupport):
2362         * Modules/modern-media-controls/media/start-support.js:
2363         (StartSupport):
2364         (StartSupport.prototype.handleEvent):
2365         (StartSupport.prototype._shouldShowStartButton):
2366         (StartSupport.prototype.get control): Deleted.
2367         (StartSupport.prototype.syncControl): Deleted.
2368         * Modules/modern-media-controls/media/status-support.js:
2369         (StatusSupport.prototype.get mediaEvents):
2370         (StatusSupport.prototype.syncControl):
2371         (StatusSupport):
2372         * Modules/modern-media-controls/media/time-control-support.js: Renamed from Source/WebCore/Modules/modern-media-controls/media/time-labels-support.js.
2373         (TimeControlSupport.prototype.syncControl):
2374         (TimeControlSupport):
2375         * Modules/modern-media-controls/media/tracks-support.js:
2376         (TracksSupport.prototype.syncControl):
2377         * WebCore.xcodeproj/project.pbxproj:
2378
2379 2017-06-05  Wenson Hsieh  <wenson_hsieh@apple.com>
2380
2381         Refactor -[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:] to check readable types
2382         https://bugs.webkit.org/show_bug.cgi?id=172891
2383         <rdar://problem/32204540>
2384
2385         Reviewed by Darin Adler.
2386
2387         Tweaks some logic in PlatformPasteboardIOS and WebItemProviderPasteboard to correctly construct objects in
2388         -valuesForPasteboardType:inItemSet:. Previously, we have a hard-coded map of UTI type to Class in the form of
2389         static helpers titled is{RichText, String, URL, Image, Color}Type in WebItemProviderPasteboard. We would use
2390         these functions to determine whether an NSAttributedString, NSString, NSURL, UIImage or UIColor should be
2391         constructed using the loaded item provider data. This is incorrect for some UTIs, such as public.html, which
2392         cannot actually be used to construct an NSAttributedString -- this caused -valuesForPasteboardType:inItemSet: to
2393         always return nil when attempting to create an object corresponding to public.html.
2394
2395         To fix this, we refactor -valuesForPasteboardType:inItemSet: to instead iterate through UIItemProviderReading-
2396         conformant classes in search for a class that can be created for the given UTI type. If no such class exists, we
2397         then fall back to custom WebKit handling of the dropped UTI type, which so far only includes reading an NSString
2398         with public.plain-text if the UTI is public.html (i.e. reading the HTML source from loaded item provider data).
2399
2400         Covered by 2 new API tests:
2401         DataInteractionTests.ExternalSourceHTMLToContentEditable
2402         DataInteractionTests.ExternalSourceAttributedStringToContentEditable
2403
2404         * platform/ios/PlatformPasteboardIOS.mm:
2405         (WebCore::PlatformPasteboard::stringForType):
2406         (WebCore::PlatformPasteboard::readString):
2407
2408         In some cases, -[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:] may now return an
2409         NSAttributedString when an NSString was previously created. This adjusts for that possibility by returning just
2410         the plain text, -[NSAttributedString string], if the read object was an NSAttributedString.
2411
2412         * platform/ios/WebItemProviderPasteboard.mm:
2413         (allLoadableClasses):
2414         (classForTypeIdentifier):
2415         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
2416
2417         See description above for more details.
2418
2419         (isRichTextType): Deleted.
2420         (isStringType): Deleted.
2421         (isURLType): Deleted.
2422         (isColorType): Deleted.
2423         (isImageType): Deleted.
2424
2425         Removes these heuristics that attempt to "guess" the best UIItemProviderReading class to try and load for a
2426         given UTI type.
2427
2428         * rendering/RenderText.cpp:
2429         (WebCore::RenderText::draggedContentRangesBetweenOffsets):
2430
2431         Adds a nil check to fix a debug assertion hit when running DataInteractionTests.
2432
2433 2017-06-05  Dan Bernstein  <mitz@apple.com>
2434
2435         Build fix for macOS 10.12
2436
2437         * platform/spi/cocoa/AVKitSPI.h:
2438
2439 2017-06-05  Dan Bernstein  <mitz@apple.com>
2440
2441         Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.
2442
2443         * platform/mac/WebPlaybackControlsManager.h:
2444         * platform/mac/WebPlaybackControlsManager.mm:
2445         (-[WebPlaybackControlsManager togglePictureInPicture]):
2446
2447 2017-06-05  Dan Bernstein  <mitz@apple.com>
2448
2449         Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.
2450
2451         * platform/spi/cocoa/AVKitSPI.h:
2452
2453 2017-06-05  Konstantin Tokarev  <annulen@yandex.ru>
2454
2455         Unreviewed, fix missing semicolon in r217795
2456
2457         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2458         (WebCore::calculateNaturalSize):
2459
2460 2017-06-05  Jer Noble  <jer.noble@apple.com>
2461
2462         Allow clients to specify a list of codecs which should require hardware decode support.
2463         https://bugs.webkit.org/show_bug.cgi?id=172787
2464
2465         Reviewed by Alex Christensen.
2466
2467         Add a new setting, checked by HTMLMediaElement, which allows MediaPlayerPrivate implementation
2468         to require that the specified codecs have hardware support. This requirement will be supported
2469         in the normal media loading path and the MSE path on Cocoa ports.
2470
2471         * WebCore.xcodeproj/project.pbxproj:
2472         * html/HTMLMediaElement.cpp:
2473         (WebCore::HTMLMediaElement::mediaCodecsRequiringHardwareSupport):
2474         * html/HTMLMediaElement.h:
2475         * page/Settings.cpp:
2476         (WebCore::Settings::setMediaCodecsRequiringHardwareSupport):
2477         * page/Settings.h:
2478         (WebCore::Settings::mediaCodecsRequiringHardwareSupport):
2479         * platform/cocoa/VideoToolboxSoftLink.cpp:
2480         * platform/cocoa/VideoToolboxSoftLink.h:
2481         * platform/graphics/MediaPlayer.h:
2482         (WebCore::MediaPlayerClient::mediaCodecsRequiringHardwareSupport):
2483         * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.h: Added.
2484         * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm: Added.
2485         (WebCore::assetTrackMeetsHardwareDecodeRequirements):
2486         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2487         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2488         (WebCore::MediaPlayerPrivateAVFoundationObjC::checkPlayability):
2489         (WebCore::MediaPlayerPrivateAVFoundationObjC::assetStatus):
2490         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2491         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
2492
2493 2017-06-05  Dan Bernstein  <mitz@apple.com>
2494
2495         Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.
2496
2497         * platform/mac/WebPlaybackControlsManager.mm:
2498         (-[WebPlaybackControlsManager togglePictureInPicture]):
2499
2500 2017-06-05  Dan Bernstein  <mitz@apple.com>
2501
2502         Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.
2503
2504         * platform/spi/mac/AVFoundationSPI.h:
2505
2506 2017-06-05  Dan Bernstein  <mitz@apple.com>
2507
2508         Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.
2509
2510         * platform/spi/cocoa/IOSurfaceSPI.h:
2511
2512 2017-06-05  Konstantin Tokarev  <annulen@yandex.ru>
2513
2514         Fix MediaPlayerPrivateMediaFoundation::naturalSize
2515         https://bugs.webkit.org/show_bug.cgi?id=172908
2516
2517         Reviewed by Alex Christensen.
2518
2519         MediaPlayerPrivateMediaFoundation::naturalSize should return size of
2520         video frame corrected by PAR, not size of video element.
2521
2522         No new tests needed.
2523
2524         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2525         (WebCore::MediaPlayerPrivateMediaFoundation::load):
2526         (WebCore::MediaPlayerPrivateMediaFoundation::naturalSize):
2527         (WebCore::MediaPlayerPrivateMediaFoundation::setNaturalSize):
2528         (WebCore::calculateNaturalSize):
2529         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::setMediaType):
2530         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2531
2532 2017-06-05  Zalan Bujtas  <zalan@apple.com>
2533
2534         Destroy the associated renderer subtree when display: contents node is deleted.
2535         https://bugs.webkit.org/show_bug.cgi?id=172920
2536         <rdar://problem/32446045>
2537
2538         Reviewed by Antti Koivisto.
2539
2540         Since display: contents node does not create a renderer, we need to explicitly check
2541         and distinguish it from the display: none case.
2542
2543         Covered by existing tests.
2544
2545         * dom/ContainerNode.cpp:
2546         (WebCore::destroyRenderTreeIfNeeded):
2547         * dom/Node.cpp:
2548         (WebCore::Node::~Node): Promote ASSERT(!renderer()) to ASSERT_WITH_SECURITY_IMPLICATION.
2549         * dom/Text.cpp:
2550         (WebCore::Text::~Text): Redundant assert. Text is a Node.
2551
2552 2017-06-05  Beth Dakin  <bdakin@apple.com>
2553
2554         Modify Netflix controlsManager quirk to prevent only scrubbing
2555         https://bugs.webkit.org/show_bug.cgi?id=172881
2556         -and corresponding-
2557         rdar://problem/32228660
2558
2559         Reviewed by Andy Estes.
2560
2561         Instead of preventing Netflix from getting a controlsManager at all, this patch 
2562         ONLY prevents touch bar scrubbing from working. This means that Netflix will now 
2563         get controls in the TouchBar, it means that the play/pause and PiP buttons will be 
2564         functional, and it means that the timeline will accurately represent the current 
2565         time, BUT users will not be able to use the timeline to scrub the video. This also 
2566         allows Netflix to work with other MediaRemote clients such as AirPods.
2567
2568         Remove the quirk code from here, since this is no longer the right place to test 
2569         if the MediaElement is hosted at Netflix.
2570         * html/HTMLMediaElement.cpp:
2571         (WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager):
2572         (WebCore::needsPlaybackControlsManagerQuirk): Deleted.
2573
2574         Pass around a new bool allowsTouchBarScrubbing.
2575         * platform/cocoa/WebPlaybackSessionModel.h:
2576         (WebCore::WebPlaybackSessionModelClient::allowsTouchBarScrubbingChanged):
2577         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
2578
2579         Here’s where we check if we need quirky behavior.
2580         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
2581         (WebCore::WebPlaybackSessionModelMediaElement::updateForEventName):
2582         (WebCore::WebPlaybackSessionModelMediaElement::allowsTouchBarScrubbing):
2583
2584         Return the bool we have plumbed through tracking whether the current site 
2585         allowsTouchBarScrubbing from the existing delegate method 
2586         canBeginTouchBarScrubbing. We will always return NO for video elements on Netflix, 
2587         and this will prevent users from be able to scrub with the TouchBar on Netflix.
2588         * platform/mac/WebPlaybackControlsManager.h:
2589         * platform/mac/WebPlaybackControlsManager.mm:
2590         (-[WebPlaybackControlsManager canBeginTouchBarScrubbing]):
2591
2592         More plumbing.
2593         * platform/mac/WebPlaybackSessionInterfaceMac.h:
2594         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
2595         (WebCore::WebPlaybackSessionInterfaceMac::allowsTouchBarScrubbingChanged):
2596         (WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
2597
2598 2017-06-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2599
2600         [GStreamer] Deadlock in MediaPlayerPrivateGStreamer::changePipelineState, web process often locks up on seeking in a youtube video that has already fully buffered
2601         https://bugs.webkit.org/show_bug.cgi?id=170003
2602
2603         Reviewed by Michael Catanzaro.
2604
2605         When video sink is requested to render a frame, the GstBaseSink preroll mutex is taken. Then WebKit media player
2606         schedules a repaint in the main thread, taking the draw mutex and waiting on draw condition. It can happen that
2607         before the repaint is done in the main thread, a pause is requested in the main thread, causing a change state
2608         from PLAYING to PAUSE. When the change state reaches the video sink gst_base_sink_change_state() tries to get
2609         the preroll mutex. This causes a deadlock because the main thread is waiting to get the preroll mutex, but the
2610         other thread is waiting for the main thread to do the repaint. GStreamer handles this case by calling unlock()
2611         on the video sink before trying to get the preroll mutex, but the media player doesn't cancel the pending
2612         repaint when using coordinated graphics. This patch adds a new signal to WebKitVideoSink "repaint-cancelled" to
2613         notify the media player to cancel the pending prepaint.
2614
2615         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2616         (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint): Release the draw mutex and notify the condition.
2617         (WebCore::MediaPlayerPrivateGStreamerBase::repaintCancelledCallback): Call cancelRepaint().
2618         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink): Connect to WebKitVideoSink::repaint-cancelled.
2619         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2620         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
2621         (webkitVideoSinkRepaintCancelled): Emit WebKitVideoSink::repaint-cancelled.
2622         (webkitVideoSinkUnlock): Call webkitVideoSinkRepaintCancelled().
2623         (webkitVideoSinkStop): Ditto.
2624         (webkit_video_sink_class_init): Add WebKitVideoSink::repaint-cancelled signal.
2625
2626 2017-06-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2627
2628         [GStreamer] Cleanup ifdefs in MediaPlayerPrivateGStreamerBase
2629         https://bugs.webkit.org/show_bug.cgi?id=172918
2630
2631         Reviewed by Michael Catanzaro.
2632
2633         The code in MediaPlayerPrivateGStreamerBase is quite difficult to follow with all the ifdefs for the
2634         possibilities when rendering. Some of them are even dead code now that all ports using GStreamer are using also
2635         coordinated graphics.
2636
2637         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2638         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
2639         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2640         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
2641         (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
2642         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2643         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2644         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
2645         (VideoRenderRequestScheduler::VideoRenderRequestScheduler):
2646         (VideoRenderRequestScheduler::stop):
2647         (VideoRenderRequestScheduler::requestRender):
2648         (webkitVideoSinkRequestRender):
2649
2650 2017-06-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2651
2652         Unreviewed. Fix compile warning when building GTK+ port without OpenGL.
2653
2654         * platform/graphics/texmap/BitmapTexturePool.cpp:
2655         (WebCore::BitmapTexturePool::createTexture):
2656
2657 2017-06-05  Miguel Gomez  <magomez@igalia.com>
2658
2659         [GTK][WPE] Do not force video sample's buffer release when the platformLayerProxy is inactive
2660         https://bugs.webkit.org/show_bug.cgi?id=172916
2661
2662         Reviewed by Carlos Garcia Campos.
2663
2664         When MediaPlayerPrivateGStreamerBase's plarformLayerProxy was inactive, a copy of the video sample
2665         was being done (without the buffer) and set, causing the sample's buffer to get freed. This was done
2666         to avoid stalling the gstreamer pipeline in situations where the video was set to display:none, as the
2667         platformLayerProxy would keep all the available buffers. But this can't happen nowadays as setting
2668         the video to display:none invalidates the proxy, causing it to release the references to the
2669         gstreamer buffers it's using. Also, the current code is causing a crash when using gstreamer-gl and
2670         the video is hidden but its contents are being painted through webgl or an accelerated canvas. So,
2671         remove this sample copy as it's not necessary anymore.
2672
2673         Covered by existent tests.
2674
2675         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2676         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
2677
2678 2017-06-05  Miguel Gomez  <magomez@igalia.com>
2679
2680         [GTK][WPE] Fix the condition to decide whether the MediaPlayer can be rendered accelerated
2681         https://bugs.webkit.org/show_bug.cgi?id=172852
2682
2683         Reviewed by Michael Catanzaro.
2684
2685         Before this change, in order to determine whether the MediaPlayer rendering could be accelerated we
2686         needed the player to have a renderer or it would return false. The renderer was needed in order to
2687         access the RenderLayerCompositor and check whether the chrome would be overwriting the accelerated
2688         compositing setting. But we don't have that option in WebKitGTK+ or WPE, so we can just check the
2689         accelerated compositing setting directly.
2690
2691         Another problems with the approach before this change is that accelerated rendering was being disabled
2692         when the video element was not visible, as there's no video renderer. Due to this, cases where the video
2693         is painted through an accelerated canvas or webgl would not be using hardware accelerated copies.
2694
2695         Covered by existent tests.
2696
2697         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2698         (WebCore::MediaPlayerPrivateGStreamerBase::acceleratedRenderingStateChanged):
2699
2700 2017-06-04  Simon Fraser  <simon.fraser@apple.com>
2701
2702         Percentages are calculated wrong in SVG transform CSS property
2703         https://bugs.webkit.org/show_bug.cgi?id=172901
2704
2705         Reviewed by Zalan Bujtas.
2706         
2707         The code added in r217236 was just fetching viewBox(), but that can be empty.
2708         SVGLengthContext::determineViewport() does the correct thing to get
2709         the appropriate viewport.
2710
2711         Test: svg/transforms/percent-transform-values-viewbox.html
2712
2713         * svg/SVGGraphicsElement.cpp:
2714         (WebCore::SVGGraphicsElement::animatedLocalTransform):
2715
2716 2017-06-04  Eric Carlson  <eric.carlson@apple.com>
2717
2718         [MediaStream] Page capture state not reported correctly
2719         https://bugs.webkit.org/show_bug.cgi?id=172897
2720         <rdar://problem/32493318>
2721
2722         Reviewed by Youenn Fablet.
2723
2724         Test: fast/mediastream/media-stream-track-muted.html
2725
2726         * Modules/mediastream/MediaStream.cpp:
2727         (WebCore::MediaStream::mediaState): Test for audio and video mute on the tracks.
2728         (WebCore::MediaStream::characteristicsChanged): Call statusDidChange when m_mediaState
2729         changes instead of m_muted, so the page is informed when just audio or video mute state
2730         changes.
2731         * Modules/mediastream/MediaStream.h:
2732
2733         * testing/Internals.cpp:
2734         (WebCore::Internals::setMediaStreamTrackMuted): New.
2735         * testing/Internals.h:
2736         * testing/Internals.idl:
2737
2738 2017-06-03  Darin Adler  <darin@apple.com>
2739
2740         Streamline handling of attributes, using references as much as possible
2741         https://bugs.webkit.org/show_bug.cgi?id=172899
2742
2743         Reviewed by Chris Dumez.
2744
2745         * accessibility/AccessibilityNodeObject.cpp:
2746         (WebCore::AccessibilityNodeObject::valueForRange): Use reference to value of
2747         attribute instead of copy to avoid reference count churn.
2748         (WebCore::AccessibilityNodeObject::maxValueForRange): Ditto.
2749         (WebCore::AccessibilityNodeObject::minValueForRange): Ditto.
2750         * accessibility/AccessibilitySVGElement.cpp:
2751         (WebCore::AccessibilitySVGElement::childElementWithMatchingLanguage): Ditto.
2752         (WebCore::AccessibilitySVGElement::accessibilityDescription): Ditto.
2753         * css/PropertySetCSSStyleDeclaration.cpp:
2754         (WebCore::StyleAttributeMutationScope::StyleAttributeMutationScope): Ditto.
2755
2756         * editing/cocoa/DataDetection.mm:
2757         (WebCore::DataDetection::shouldCancelDefaultAction): Use the
2758         equalLettersIgnoringASCIICase function instead of using
2759         both equalIgnoringASCIICase and convertToASCIILowercase.
2760
2761         * html/HTMLAudioElement.cpp:
2762         (WebCore::HTMLAudioElement::HTMLAudioElement): Marked this inline since we
2763         want it inlined the one place it's used.
2764         (WebCore::HTMLAudioElement::create): Use auto and named the local variable
2765         just element.
2766         (WebCore::HTMLAudioElement::createForJSConstructor): Call create rather than
2767         repeating the code from create. Use setAttributeWithoutSynchronization directly
2768         rather than calling helper functions. Removed unneeded null check;
2769         setAttributeWithoutSynchronization handles null by removing the attribute.
2770         * html/HTMLAudioElement.h: Changed src argument of createForJSConstructor to
2771         take AtomicString since that is what we need for an attribute value.
2772         * html/HTMLAudioElement.idl: Use [AtomicString] for src argument.
2773
2774         * html/HTMLElement.cpp:
2775         (WebCore::HTMLElement::directionality): Use reference to value of
2776         attribute instead of copy to avoid reference count churn.
2777         (WebCore::HTMLElement::shouldAutocorrect): Ditto.
2778
2779         * html/HTMLImageElement.cpp:
2780         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement): Call the new
2781         parsedMediaAttribute instead of the old mediaQuerySet function. Other than the
2782         name, the only change is that the result is now a const pointer.
2783
2784         * html/HTMLInputElement.cpp:
2785         (WebCore::HTMLInputElement::updateType): Removed unnecessary local variable,
2786         resulting in code that is slightly cleaner and possibly eliminating reference
2787         count chrun.
2788
2789         * html/HTMLMediaElement.cpp:
2790         (WebCore::HTMLMediaElement::setSrc): Deleted.
2791         (WebCore::HTMLMediaElement::selectNextSourceChild): Use parsedMediaAttribute and
2792         removed rendudant direct check of whether mediaAttr is present. Changed logging to
2793         get the media attribute directly rather than with a helper function. Changed type
2794         to get the type attribute directly rather than with a helper function.
2795         (WebCore::HTMLMediaElement::sourceWasAdded): Take a reference rather than a pointer.
2796         (WebCore::HTMLMediaElement::sourceWasRemoved): Ditto.
2797         (WebCore::HTMLMediaElement::doesHaveAttribute): Use reference to value of
2798         attribute instead of copy to avoid reference count churn.
2799         * html/HTMLMediaElement.h: Updated for the above.
2800
2801         * html/HTMLSourceElement.cpp:
2802         (WebCore::HTMLSourceElement::insertedInto): Pass reference instead of pointer.
2803         (WebCore::HTMLSourceElement::removedFrom): Ditto.
2804         (WebCore::HTMLSourceElement::setSrc): Deleted.
2805         (WebCore::HTMLSourceElement::media): Deleted.
2806         (WebCore::HTMLSourceElement::setMedia): Deleted.
2807         (WebCore::HTMLSourceElement::type): Deleted.
2808         (WebCore::HTMLSourceElement::setType): Deleted.
2809         (WebCore::HTMLSourceElement::parseAttribute): Clear out m_cachedParsedMediaAttribute.
2810         This makes the parsing be lazy. The old code would parse the attribute value to make
2811         a MediaQuerySet here, but we do it in parsedMediaAttribute now.
2812         (WebCore::HTMLSourceElement::parsedMediaAttribute): Added. Creates a MediaQuerySet
2813         if needed, and returns it or null.
2814         * html/HTMLSourceElement.h: Removed include of MediaList.h. Removed unneeded media,
2815         type, setSrc, setMedia, and setType functions. Replaced the mediaQuerySet function
2816         with the parsedMediaAttribute, which returns a const pointer rather than non-const,
2817         and is also non-inline because it lazily creates the MediaQuerySet as needed. Replaced
2818         m_mediaQuerySet with m_cachedParsedMediaAttribute.
2819         * html/HTMLSourceElement.idl: Use [Reflect] for both type and media.
2820
2821         * html/MediaDocument.cpp: Modernize the MediaDocumentParser constructor.
2822         (WebCore::MediaDocumentParser::createDocumentStructure): Instead of setSrc, use
2823         setAttributeWithoutSynchronization for the src attribute just as we do for all the
2824         other attributes of the newly created video element.
2825
2826         * html/MediaElementSession.cpp:
2827         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled): Use reference to
2828         value of attribute instead of copy to avoid reference count churn.
2829         * loader/FrameLoader.cpp:
2830         (WebCore::FrameLoader::defaultSubstituteDataForURL): Ditto.
2831         * rendering/RenderThemeIOS.mm:
2832         (WebCore::getAttachmentProgress): Ditto.
2833         * rendering/RenderThemeMac.mm:
2834         (WebCore::AttachmentLayout::layOutSubtitle): Ditto.
2835         (WebCore::RenderThemeMac::paintAttachment): Ditto.
2836         * svg/SVGHKernElement.cpp:
2837         (WebCore::SVGHKernElement::buildHorizontalKerningPair): Ditto.
2838         * svg/SVGVKernElement.cpp:
2839         (WebCore::SVGVKernElement::buildVerticalKerningPair): Ditto.
2840         * svg/animation/SVGSMILElement.cpp:
2841         (WebCore::SVGSMILElement::buildPendingResource): Ditto. Also use parentElement
2842         instead of writing out code that does exactly what it does.
2843
2844 2017-06-03  Sam Weinig  <sam@webkit.org>
2845
2846         Can't use Object.defineProperty() to add an item to a DOMStringMap or Storage
2847         https://bugs.webkit.org/show_bug.cgi?id=172687
2848
2849         Reviewed by Darin Adler.
2850
2851         - Adds support for generating the defineOwnProperty ClassInfo method table hook
2852           to add support for Object.defineProperty(). The implementation follows WebIDL
2853           section 3.9.3 [[DefineOwnProperty]].
2854           (https://heycam.github.io/webidl/#legacy-platform-object-defineownproperty)
2855         - Adds support for generating named setters in addition to the already supported
2856           indexed setters as much of the required work was needed to make defineOwnProperty
2857           work for those properties. This patch does not aim to follow WebIDL faithfully,
2858           but rather to generate as close to the custom code as possible. A follow up 
2859           change will attempt to match WebIDL more closely (which will also require changes
2860           to [[GetOwnPropertySlot]]).
2861         - Removes the need for custom bindings in DOMStringMap, HTMLOptionsCollection and
2862           HTMLSelectElement. Gets us one function away from supporting Storage.
2863         - Tidies up generated headers a bit by grouping all the ClassInfo method table hooks
2864           together.
2865         - Removes support for CustomIndexedSetter, which is no longer used.
2866
2867         Test: js/dom/legacy-platform-object-defineOwnProperty.html
2868
2869         * CMakeLists.txt:
2870         * WebCore.xcodeproj/project.pbxproj:
2871         * bindings/js/JSBindingsAllInOne.cpp:
2872         Removed now unneeded custom bindings.
2873
2874         * bindings/js/JSDOMStringMapCustom.cpp: Removed.
2875         * bindings/js/JSHTMLOptionsCollectionCustom.cpp: Removed.
2876         * bindings/js/JSHTMLSelectElementCustom.cpp: Removed.
2877         * bindings/js/JSHTMLSelectElementCustom.h: Removed.
2878         * bindings/js/JSStorageCustom.cpp:
2879         (WebCore::JSStorage::putDelegate): Deleted.
2880         Remove more code that is now generated.
2881
2882         * bindings/scripts/CodeGeneratorJS.pm:
2883         (GenerateIndexedGetter):
2884         - Add missing check for indexed setter operation when determining if the property should be ReadOnly.
2885         - Add support for custom implementation name, matching GenerateNamedGetter.
2886         - Convert to taking an outputArray and indent to allow more flexibility going forward.
2887
2888         (GenerateNamedGetter):
2889         - Add missing check for named setter operation when determining if the property should be ReadOnly.
2890         - Convert to taking an outputArray and indent to allow more flexibility going forward.
2891
2892         (GenerateGetOwnPropertySlotBody):
2893         - Convert to taking an outputArray and indent to allow more flexibility going forward.
2894         - Take over responsibility for checking and bailing if CustomGetOwnPropertySlot is set.
2895
2896         (GenerateGetOwnPropertySlotBodyByIndex):
2897         - Convert to taking an outputArray and indent to allow more flexibility going forward.
2898         - Take over responsibility for checking and bailing if CustomGetOwnPropertySlotByIndex is set.
2899
2900         (GenerateGetOwnPropertyNames):
2901         - Convert to taking an outputArray and indent to allow more flexibility going forward.
2902         - Take over responsibility for checking and bailing if CustomEnumerateProperty is set.
2903
2904         (GenerateInvokeIndexedPropertySetter):
2905         Added. Implements the 'invoke an indexed property setter' algorithm (https://heycam.github.io/webidl/#invoke-indexed-setter)
2906
2907         (GenerateInvokeNamedPropertySetter):
2908         Added. Implements the 'invoke a named property setter' algorithm (https://heycam.github.io/webidl/#invoke-named-setter)
2909
2910         (GeneratePut):
2911         (GeneratePutByIndex):
2912         - Convert to taking an outputArray and indent to allow more flexibility going forward.
2913         - Take over responsibility for checking and bailing if CustomPut is set.
2914         - Adds support for CEReactions.
2915         - Adopts GenerateInvokeIndexedPropertySetter and GenerateInvokeNamedPropertySetter to
2916           simplify code.
2917         - Removes support for CustomIndexedSetter, which is no longer used.
2918         - Replaces use direct checking of OverrideBuiltins with check if any interface it inherits
2919           has it, which is how it is specified to work.
2920
2921         (GenerateIsUnforgeablePropertyName):
2922         Added. Helper subroutine to generate a function that compares a property name
2923         agains all the property names defined as Unforgeable on the interface. Used by
2924         GenerateDefineOwnProperty.
2925
2926         (GenerateDefineOwnProperty):
2927         Added. Implements section 3.9.3 [[DefineOwnProperty]] (https://heycam.github.io/webidl/#legacy-platform-object-defineownproperty)
2928         Adds support for CEReactions.
2929
2930         (GenerateDeletePropertyCommon):
2931         Switch from getting OverrideBuiltins directly off the interface to using InheritsExtendedAttribute.
2932
2933         (GenerateNamedDeleterDefinition):
2934         Switch signature to match peer generators.
2935
2936         (InstanceOverridesGetOwnPropertySlot):
2937         Update for rename of JSCustomGetOwnPropertySlotAndDescriptor to CustomGetOwnPropertySlotAndDescriptor.
2938
2939         (InstanceOverridesGetOwnPropertySlotByIndex):
2940         Added. Like InstanceOverridesGetOwnPropertySlot, but checks for the new CustomGetOwnPropertySlotByIndex 
2941         rather than CustomGetOwnPropertySlot.
2942
2943         (InstanceOverridesGetOwnPropertyNames):
2944         Added. Moves complex predicate out of line.
2945
2946         (InstanceOverridesPut):
2947         Removes now unused CustomIndexedSetter, and adds CustomPutFunction, which used to be checked separately.
2948
2949         (InstanceOverridesDefineOwnProperty):
2950         Added.
2951
2952         (GenerateHeader):
2953         - Moves more structure flags together.
2954         - Simplifies predicates and moves the ClassInfo method table hooks together.
2955
2956         (GenerateImplementation):
2957         - Moves the ClassInfo method table hooks together
2958         - Adds call to GenerateDefineOwnProperty.
2959
2960         (GenerateLegacyCallerDefinitions):
2961         Simplify bail condition to match other generators.
2962
2963         (GeneratePrototypeDeclaration):
2964         Update for new extended attribute names.
2965
2966         (InstanceOverridesCall): 
2967         Renamed from IsCallable for consistency.
2968         
2969         (HasComplexGetOwnProperty): 
2970         Deleted. Unused.
2971         
2972         (InstanceOverridesPutImplementation): 
2973         Deleted. Unused.
2974         
2975         (InstanceOverridesPutDeclaration): 
2976         Deleted. Unused.
2977         
2978         (IsCallable): 
2979         Renamed, for consistency, to InstanceOverridesCall .
2980
2981         * bindings/scripts/IDLAttributes.json:
2982         Renames a few of the extended attributes to remove the JS prefix. This time
2983         around I only did the ones in the area I was working, but we should probably
2984         remove most of the rest.
2985     
2986         * css/CSSStyleDeclaration.idl:
2987         Update for JSCustomGetOwnPropertySlotAndDescriptor -> CustomGetOwnPropertySlotAndDescriptor rename.
2988
2989         * dom/DOMStringMap.idl:
2990         Remove CustomNamedSetter and add uncomment out the setter.
2991
2992         * dom/DatasetDOMStringMap.cpp:
2993         (WebCore::DatasetDOMStringMap::setNamedItem):
2994         (WebCore::DatasetDOMStringMap::setItem): Deleted.
2995         * dom/DatasetDOMStringMap.h:
2996         Rename setItem to setNamedItem, which is what the generator expects.
2997
2998         * dom/Node.idl:
2999         Update for JSCustomPushEventHandlerScope -> CustomPushEventHandlerScope rename.
3000
3001         * html/HTMLAppletElement.idl:
3002         * html/HTMLEmbedElement.idl:
3003         * html/HTMLObjectElement.idl:
3004         Update for JSCustomGetOwnPropertySlotAndDescriptor -> CustomGetOwnPropertySlotAndDescriptor rename.
3005
3006         * html/HTMLCollection.cpp:
3007         (WebCore::HTMLCollection::isSupportedPropertyName):
3008         * html/HTMLCollection.h:
3009         Add isSupportedPropertyName function which is used by the bindings and is now needed.
3010
3011         * html/HTMLElement.idl:
3012         Update for JSCustomPushEventHandlerScope -> CustomPushEventHandlerScope rename.
3013
3014         * html/HTMLOptionsCollection.h:
3015         (WebCore::HTMLOptionsCollection::setItem):
3016         Add setItem() implementation which just forwards to the select element. Also, add 
3017         a type alias to make the implementations of item and namedItem less verbose.
3018
3019         * html/HTMLOptionsCollection.idl:
3020         Remove CustomIndexedSetter and uncomment the setter.
3021
3022         * html/HTMLSelectElement.idl:
3023         Remove CustomIndexedSetter and uncomment the setter. Also, reformat
3024         to match the WHATWG spec.
3025
3026         * page/DOMWindow.idl:
3027         Update for JSCustomDefineOwnProperty -> CustomDefineOwnProperty rename. Add 
3028         CustomGetOwnPropertySlotByIndex which is now needed to remove some unsound
3029         assumptions the generator was making.
3030
3031         * page/Location.idl:
3032         Update for removal of JS prefix from a bunch of extended attributes.
3033
3034         * page/UserMessageHandlersNamespace.idl:
3035         Update for JSCustomGetOwnPropertySlotAndDescriptor -> CustomGetOwnPropertySlotAndDescriptor rename.
3036
3037         * storage/Storage.idl:
3038         Remove CustomNamedSetter and uncomment the setter.
3039
3040         * bindings/scripts/test/JS/JSInterfaceName.h:
3041         * bindings/scripts/test/JS/JSTestEventTarget.h:
3042         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: Added.
3043         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h: Added.
3044         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: Added.
3045         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h: Added.
3046         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: Added.
3047         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h: Added.
3048         * bindings/scripts/test/JS/JSTestInterface.cpp:
3049         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: Added.
3050         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h: Added.
3051         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: Added.
3052         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h: Added.
3053         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: Added.
3054         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h: Added.
3055         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
3056         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
3057         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
3058         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
3059         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
3060         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: Added.
3061         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h: Added.
3062         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: Added.
3063         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h: Added.
3064         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: Added.
3065         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h: Added.
3066         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: Added.
3067         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h: Added.
3068         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: Added.
3069         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h: Added.
3070         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: Added.
3071         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h: Added.
3072         * bindings/scripts/test/JS/JSTestObj.cpp:
3073         * bindings/scripts/test/JS/JSTestObj.h:
3074         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
3075         * bindings/scripts/test/TestIndexedSetterNoIdentifier.idl: Added.
3076         * bindings/scripts/test/TestIndexedSetterThrowingException.idl: Added.
3077         * bindings/scripts/test/TestIndexedSetterWithIdentifier.idl: Added.
3078         * bindings/scripts/test/TestNamedAndIndexedSetterNoIdentifier.idl: Added.
3079         * bindings/scripts/test/TestNamedAndIndexedSetterThrowingException.idl: Added.
3080         * bindings/scripts/test/TestNamedAndIndexedSetterWithIdentifier.idl: Added.
3081         * bindings/scripts/test/TestNamedDeleterWithIdentifier.idl:
3082         * bindings/scripts/test/TestNamedSetterNoIdentifier.idl: Added.
3083         * bindings/scripts/test/TestNamedSetterThrowingException.idl: Added.
3084         * bindings/scripts/test/TestNamedSetterWithIdentifier.idl: Added.
3085         * bindings/scripts/test/TestNamedSetterWithOverrideBuiltins.idl: Added.
3086         * bindings/scripts/test/TestNamedSetterWithUnforgableProperties.idl: Added.
3087         * bindings/scripts/test/TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.idl: Added.
3088         Added new tests and updated some results.
3089
3090 2017-06-04  Simon Fraser  <simon.fraser@apple.com>
3091
3092         Object bounding box wrong for some paths
3093         https://bugs.webkit.org/show_bug.cgi?id=172866
3094
3095         Reviewed by Tim Horton.
3096         
3097         RenderSVGShape::calculateObjectBoundingBox() should use boundingRect()
3098         rather than fastBoundingRect(), because the latter includes control points.
3099
3100         Covered by existing tests.
3101
3102         * rendering/svg/RenderSVGShape.cpp:
3103         (WebCore::RenderSVGShape::calculateObjectBoundingBox):
3104
3105 2017-06-04  Konstantin Tokarev  <annulen@yandex.ru>
3106
3107         Fix build of Windows-specific code with ICU 59.1
3108         https://bugs.webkit.org/show_bug.cgi?id=172729
3109
3110         Reviewed by Darin Adler.
3111
3112         Fix conversions from WTF::String to wchar_t* and vice versa.
3113         No new tests needed.
3114
3115         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3116         (WebCore::mimeTypeCache):
3117         (WebCore::MediaPlayerPrivateMediaFoundation::startCreateMediaSource):
3118
3119 2017-06-04  Chris Dumez  <cdumez@apple.com>
3120
3121         Implement DOMMatrixReadOnly.transformPoint()
3122         https://bugs.webkit.org/show_bug.cgi?id=172900
3123
3124         Reviewed by Simon Fraser.
3125
3126         Implement DOMMatrixReadOnly.transformPoint():
3127         - https://drafts.fxtf.org/geometry/#dommatrixreadonly
3128         - https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-transformpoint
3129
3130         Test: imported/blink/fast/dom/geometry-interfaces-dom-matrix-transformPoint.html
3131
3132         * css/DOMMatrixReadOnly.cpp:
3133         (WebCore::DOMMatrixReadOnly::transformPoint):
3134         * css/DOMMatrixReadOnly.h:
3135         * css/DOMMatrixReadOnly.idl:
3136
3137 2017-06-04  Zan Dobersek  <zdobersek@igalia.com>
3138
3139         [GCrypt] Improve comments in AES, PBKDF2, RSA-SSA algorithm implementations
3140         https://bugs.webkit.org/show_bug.cgi?id=172894
3141
3142         Reviewed by Michael Catanzaro.
3143
3144         Add or improve code comments in libgcrypt implementations for the AES_CBC,
3145         AES_GCM, AES_KW, PBKDF2 and RSA-SSA algorithms.
3146
3147         * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp: Add generic comments that
3148         describe each operation that's performed.
3149         (WebCore::gcryptEncrypt):
3150         (WebCore::gcryptDecrypt):
3151         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp: Ditto.
3152         (WebCore::gcryptEncrypt):
3153         (WebCore::gcryptDecrypt):
3154         * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp: Ditto.
3155         (WebCore::gcryptWrapKey):
3156         (WebCore::gcryptUnwrapKey):
3157         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp: Ditto.
3158         (WebCore::gcryptDeriveBits):
3159         * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
3160         (WebCore::gcryptVerify): Align the verification results comment with the
3161         one that's used in the ECDSA implementation.
3162
3163 2017-06-03  Chris Dumez  <cdumez@apple.com>
3164
3165         Implement DOMMatrix's fromFloat32Array / fromFloat64Array & toFloat32Array / toFloat64Array
3166         https://bugs.webkit.org/show_bug.cgi?id=172898
3167
3168         Reviewed by Sam Weinig.
3169
3170         Implement DOMMatrix's fromFloat32Array / fromFloat64Array & toFloat32Array / toFloat64Array
3171         as per:
3172         - https://drafts.fxtf.org/geometry/#dommatrixreadonly
3173
3174         Test: http/wpt/geometry/DOMMatrix-from-to-typed-arrays.html
3175
3176         * css/DOMMatrix.cpp:
3177         (WebCore::DOMMatrix::fromFloat32Array):
3178         (WebCore::DOMMatrix::fromFloat64Array):
3179         * css/DOMMatrix.h:
3180         * css/DOMMatrix.idl:
3181         * css/DOMMatrixReadOnly.cpp:
3182         (WebCore::DOMMatrixReadOnly::fromFloat32Array):
3183         (WebCore::DOMMatrixReadOnly::fromFloat64Array):
3184         (WebCore::DOMMatrixReadOnly::toFloat32Array):
3185         (WebCore::DOMMatrixReadOnly::toFloat64Array):
3186         * css/DOMMatrixReadOnly.h:
3187         * css/DOMMatrixReadOnly.idl:
3188
3189 2017-06-03  Simon Fraser  <simon.fraser@apple.com>
3190
3191         Implement DOMPointReadOnly.matrixTransform()
3192         https://bugs.webkit.org/show_bug.cgi?id=172896
3193
3194         Reviewed by Chris Dumez.
3195
3196         DOMPointReadOnly.matrixTransform() creates the matrix or throws, then uses
3197         a new function in TransformationMatrix to map x,y,z,w through the matrix.
3198
3199         Test: http/wpt/geometry/DOMPoint-003.html
3200
3201         * CMakeLists.txt:
3202         * WebCore.xcodeproj/project.pbxproj:
3203         * css/DOMMatrixReadOnly.h:
3204         (WebCore::DOMMatrixReadOnly::transformationMatrix):
3205         * dom/DOMPointReadOnly.cpp: Copied from Source/WebCore/dom/DOMPointReadOnly.idl.
3206         (WebCore::DOMPointReadOnly::matrixTransform):
3207         * dom/DOMPointReadOnly.h:
3208         * dom/DOMPointReadOnly.idl:
3209         * platform/graphics/transforms/TransformationMatrix.cpp:
3210         (WebCore::TransformationMatrix::map4ComponentPoint):
3211         * platform/graphics/transforms/TransformationMatrix.h:
3212
3213 2017-06-03  Myles C. Maxfield  <mmaxfield@apple.com>
3214
3215         Cleanup arguments to preparePlatformFont() and fontWithFamily() in FontCacheCoreText.cpp
3216         https://bugs.webkit.org/show_bug.cgi?id=172886
3217
3218         Reviewed by Simon Fraser.
3219
3220         The number of arguments is getting out of control.
3221
3222         No new tests because there is no behavior change.
3223
3224         * platform/graphics/FontCache.h:
3225         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3226         (WebCore::preparePlatformFont):
3227         (WebCore::fontWithFamily):
3228         (WebCore::FontCache::createFontPlatformData):
3229         (WebCore::FontCache::systemFallbackForCharacters):
3230         * platform/graphics/mac/FontCacheMac.mm:
3231         (WebCore::platformFontWithFamilySpecialCase):
3232         * platform/graphics/mac/FontCustomPlatformData.cpp:
3233         (WebCore::FontCustomPlatformData::fontPlatformData):
3234         * platform/spi/cocoa/CoreTextSPI.h:
3235
3236 2017-06-03  Yusuke Suzuki  <utatane.tea@gmail.com>
3237
3238         Script modules should be able to import data urls
3239         https://bugs.webkit.org/show_bug.cgi?id=171594
3240
3241         Reviewed by Youenn Fablet.
3242
3243         Tests: js/dom/classic-script-with-data-url.html
3244                js/dom/modules/module-script-with-data-url.html
3245
3246         Script tag resources should have SameOriginDataURLFlag::Set to load data URLs
3247         since script tags should treat data URLs as same origin.
3248
3249         * bindings/js/CachedScriptFetcher.cpp:
3250         (WebCore::CachedScriptFetcher::requestScriptWithCache):
3251
3252 2017-06-03  Simon Fraser  <simon.fraser@apple.com>
3253
3254         Sort the project file.
3255
3256         * WebCore.xcodeproj/project.pbxproj:
3257
3258 2017-06-03  Zan Dobersek  <zdobersek@igalia.com>
3259
3260         [GCrypt] Gather SUBTLE_CRYPTO utility functions in a single header
3261         https://bugs.webkit.org/show_bug.cgi?id=172870
3262
3263         Reviewed by Jiewen Tan.
3264
3265         Gather the helper functions used across different source files
3266         for libgcrypt-backed SUBTLE_CRYPTO implementations in a single
3267         header file.
3268
3269         * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
3270         (WebCore::hashCryptoDigestAlgorithm): Deleted.
3271         (WebCore::hashAlgorithmName): Deleted.
3272         (WebCore::mpiData): Deleted.
3273         * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
3274         (WebCore::gcryptDeriveBits):
3275         (WebCore::macAlgorithmForHashFunction): Deleted.
3276         * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
3277         (WebCore::gcryptDeriveBits):
3278         * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
3279         (WebCore::mpiData): Deleted.
3280         * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
3281         (WebCore::hashCryptoDigestAlgorithm): Deleted.
3282         (WebCore::hashAlgorithmName): Deleted.
3283         (WebCore::mpiData): Deleted.
3284         * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
3285         (WebCore::hashAlgorithmName): Deleted.
3286         (WebCore::mpiData): Deleted.
3287         * crypto/gcrypt/GCryptUtilities.h: Added.
3288         (WebCore::hashAlgorithmName):
3289         (WebCore::hmacAlgorithm):
3290         (WebCore::digestAlgorithm):
3291         (WebCore::hashCryptoDigestAlgorithm):
3292         (WebCore::mpiData):
3293
3294 2017-06-03  Zan Dobersek  <zdobersek@igalia.com>
3295
3296         [GCrypt] Fix PK verification for ECDSA
3297         https://bugs.webkit.org/show_bug.cgi?id=172857
3298
3299         Reviewed by Michael Catanzaro.
3300
3301         No new tests -- covered by existing tests.
3302
3303         * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
3304         (WebCore::gcryptVerify): Return `true` if the verification succeeded or `false`
3305         in any other case, avoiding spilling information about the exact cause of
3306         verification failure.
3307
3308 2017-06-02  Zalan Bujtas  <zalan@apple.com>
3309
3310         Cleanup FrameView::autoSizeIfEnabled.
3311         https://bugs.webkit.org/show_bug.cgi?id=172889
3312         <rdar://problem/32550783>
3313
3314         Reviewed by Tim Horton.
3315
3316         This patch ensures that we always have a clean tree (and a valid and current document size) when
3317         setting m_autoSizeContentSize. 
3318
3319         * page/FrameView.cpp:
3320         (WebCore::FrameView::autoSizeIfEnabled):
3321
3322 2017-06-02  Wenson Hsieh  <wenson_hsieh@apple.com>
3323
3324         REGRESSION(r216212): RenderReplaced::paint() should not save and restore the context unless it has to
3325         https://bugs.webkit.org/show_bug.cgi?id=172883
3326         <rdar://problem/32548614>
3327
3328         Reviewed by Tim Horton.
3329
3330         After implementing dragged content fading, RenderReplace::paint is now always guarded by unnecessary calls to
3331         GraphicsContext::save and GraphicsContext::restore, even when there is no dragged content being rendered. To
3332         address this, we initialize our GraphicsContextStateSaver with saveAndRestore = false, indicating that we don't
3333         want to immediately try and save the context.
3334
3335         If we are in a dragged content range, we will then call GraphicsContextStateSaver::save, which saves the
3336         graphics context and also causes the GraphicsContextStateSaver to eventually try and restore() when it is
3337         destroyed. Otherwise, in the common codepath where the renderer is not in a dragged content range, the
3338         constructor and destructor of GraphicsContextStateSaver will be no-ops with respect to saving and restoring the
3339         graphics context.
3340
3341         * rendering/RenderReplaced.cpp:
3342         (WebCore::RenderReplaced::paint):
3343
3344 2017-06-02  Myles C. Maxfield  <mmaxfield@apple.com>
3345
3346         REGRESSION(r213464): [iOS] Fonts get too bold when the "Bold Text" accessibility setting is enabled
3347         https://bugs.webkit.org/show_bug.cgi?id=172737
3348
3349         Reviewed by Simon Fraser.
3350
3351         Revert the part of r213464 which changed how we calculate the weights of system fonts.
3352
3353         Add an InternalSetting to trigger our mock of the accessbility "Bold Text" setting. We can't
3354         use the real setting, so instead we just ask for bold fonts instead of regular fonts when this
3355         setting is true.
3356
3357         Tests: fast/text/accessibility-bold-system-font.html
3358                fast/text/accessibility-bold-system-font-2.html
3359
3360         * platform/graphics/FontCache.h:
3361         (WebCore::FontCache::shouldMockBoldSystemFontForAccessibility):