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