Title: [207368] trunk
Revision
207368
Author
cdu...@apple.com
Date
2016-10-14 18:48:36 -0700 (Fri, 14 Oct 2016)

Log Message

Setting HTMLMediaElement.muted to the same value should not fire a volume change event
https://bugs.webkit.org/show_bug.cgi?id=163474

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/html/semantics/embedded-content/media-elements/event_volumechange-expected.txt:

Source/WebCore:

Setting HTMLMediaElement.muted to the same value should not fire a volume
change event:
- https://html.spec.whatwg.org/#dom-media-muted

Chrome and Firefox agree with the specification.

No new tests, rebaselined existing test.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setMuted):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (207367 => 207368)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2016-10-15 00:40:25 UTC (rev 207367)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2016-10-15 01:48:36 UTC (rev 207368)
@@ -1,3 +1,14 @@
+2016-10-14  Chris Dumez  <cdu...@apple.com>
+
+        Setting HTMLMediaElement.muted to the same value should not fire a volume change event
+        https://bugs.webkit.org/show_bug.cgi?id=163474
+
+        Reviewed by Eric Carlson.
+
+        Rebaseline W3C test now that more checks are passing.
+
+        * web-platform-tests/html/semantics/embedded-content/media-elements/event_volumechange-expected.txt:
+
 2016-10-14  Youenn Fablet  <you...@apple.com>
 
         Make NetworkCache aware of fetch cache mode

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/event_volumechange-expected.txt (207367 => 207368)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/event_volumechange-expected.txt	2016-10-15 00:40:25 UTC (rev 207367)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/event_volumechange-expected.txt	2016-10-15 01:48:36 UTC (rev 207368)
@@ -1,10 +1,10 @@
 
 PASS setting audio.volume fires volumechange 
 PASS setting audio.muted fires volumechange 
-FAIL setting audio.volume/muted to the same value does not fire volumechange assert_unreached: Reached unreachable code
+PASS setting audio.volume/muted to the same value does not fire volumechange 
 PASS setting audio.volume/muted repeatedly fires volumechange repeatedly 
 PASS setting video.volume fires volumechange 
 PASS setting video.muted fires volumechange 
-FAIL setting video.volume/muted to the same value does not fire volumechange assert_unreached: Reached unreachable code
+PASS setting video.volume/muted to the same value does not fire volumechange 
 PASS setting video.volume/muted repeatedly fires volumechange repeatedly 
 

Modified: trunk/Source/WebCore/ChangeLog (207367 => 207368)


--- trunk/Source/WebCore/ChangeLog	2016-10-15 00:40:25 UTC (rev 207367)
+++ trunk/Source/WebCore/ChangeLog	2016-10-15 01:48:36 UTC (rev 207368)
@@ -1,3 +1,21 @@
+2016-10-14  Chris Dumez  <cdu...@apple.com>
+
+        Setting HTMLMediaElement.muted to the same value should not fire a volume change event
+        https://bugs.webkit.org/show_bug.cgi?id=163474
+
+        Reviewed by Eric Carlson.
+
+        Setting HTMLMediaElement.muted to the same value should not fire a volume
+        change event:
+        - https://html.spec.whatwg.org/#dom-media-muted
+
+        Chrome and Firefox agree with the specification.
+
+        No new tests, rebaselined existing test.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::setMuted):
+
 2016-10-14  Dean Jackson  <d...@apple.com>
 
         Add Display P3 ColorSpace

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (207367 => 207368)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2016-10-15 00:40:25 UTC (rev 207367)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2016-10-15 01:48:36 UTC (rev 207368)
@@ -3302,7 +3302,8 @@
 {
     LOG(Media, "HTMLMediaElement::setMuted(%p) - %s", this, boolString(muted));
 
-    if (m_muted != muted || !m_explicitlyMuted) {
+    bool mutedStateChanged = m_muted != muted;
+    if (mutedStateChanged || !m_explicitlyMuted) {
         m_muted = muted;
         m_explicitlyMuted = true;
 
@@ -3317,8 +3318,10 @@
                     mediaControls()->changedMute();
             }
         }
-        scheduleEvent(eventNames().volumechangeEvent);
 
+        if (mutedStateChanged)
+            scheduleEvent(eventNames().volumechangeEvent);
+
         updateShouldPlay();
 
 #if ENABLE(MEDIA_SESSION)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to