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