Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1160)

Unified Diff: third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp

Issue 2477203002: Media Controls: delegate 'volumechange' and 'focusin' handling to an EventListener. (Closed)
Patch Set: add comment Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
index e60254555d49888e44e5603c68773519b13e9f57..5f4a1f06792dff6ac9b94b0f04a0abf3444344fc 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
@@ -299,7 +299,12 @@ void MediaControlMuteButtonElement::defaultEventHandler(Event* event) {
}
void MediaControlMuteButtonElement::updateDisplayType() {
- setDisplayType(mediaElement().muted() ? MediaUnMuteButton : MediaMuteButton);
+ // TODO(mlamouri): checking for volume == 0 because the mute button will look
+ // 'muted' when the volume is 0 even if the element is not muted. This allows
+ // the painting and the display type to actually match.
+ setDisplayType((mediaElement().muted() || mediaElement().volume() == 0)
+ ? MediaUnMuteButton
+ : MediaMuteButton);
updateOverflowString();
}
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMediaElement.cpp ('k') | third_party/WebKit/Source/core/html/shadow/MediaControls.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698