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

Unified Diff: LayoutTests/media/audio-controls-computed-display.html

Issue 1166743004: Force display:none for audio elements with no controls attribute (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months 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: LayoutTests/media/audio-controls-computed-display.html
diff --git a/LayoutTests/media/audio-controls-computed-display.html b/LayoutTests/media/audio-controls-computed-display.html
new file mode 100644
index 0000000000000000000000000000000000000000..b83aa365c491dd7df418814078a3399e606aac71
--- /dev/null
+++ b/LayoutTests/media/audio-controls-computed-display.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<title>&lt;audio> without controls has display:none irrespective of author CSS</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<style>
+audio {
+ display: inline !important;
+}
+</style>
+<div id="log"></div>
+<script>
+test(function() {
+ var audio = document.createElement('audio');
+ document.body.appendChild(audio);
+ assert_equals(audio.clientWidth, 0);
+ assert_equals(getComputedStyle(audio).display, "none");
+ audio.controls = true;
+ assert_equals(audio.clientWidth, 300);
+ assert_equals(getComputedStyle(audio).display, "inline");
+ audio.controls = false;
+ assert_equals(audio.clientWidth, 0);
+ assert_equals(getComputedStyle(audio).display, "none");
+});
+</script>
« no previous file with comments | « LayoutTests/fast/forms/label/label-contains-other-interactive-content.html ('k') | Source/core/css/mediaControls.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698