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

Unified Diff: LayoutTests/media/audio-controls-style-invalidation.html

Issue 1170583002: Recalc style or reattach when adding or removing the audio 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-style-invalidation.html
diff --git a/LayoutTests/media/audio-controls-style-invalidation.html b/LayoutTests/media/audio-controls-style-invalidation.html
new file mode 100644
index 0000000000000000000000000000000000000000..b52652585781e048f849b8333b308327884c3aed
--- /dev/null
+++ b/LayoutTests/media/audio-controls-style-invalidation.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<title>Style invalidation when adding/removing audio controls</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+test(function() {
+ var audio = document.createElement('audio');
+ document.body.appendChild(audio);
+ // Note: The clientWidth getter in this assert will force a layout.
+ // Without that, the test would pass for the wrong reasons.
+ assert_equals(audio.clientWidth, 0);
+ audio.controls = true;
+ assert_equals(audio.clientWidth, 300);
+}, "Style invalidation when adding audio controls");
+
+test(function() {
+ var audio = document.createElement('audio');
+ document.body.appendChild(audio);
+ audio.controls = true;
+ assert_equals(audio.clientWidth, 300);
+ audio.controls = false;
+ assert_equals(audio.clientWidth, 0);
+}, "Style invalidation when removing audio controls");
+</script>
« no previous file with comments | « LayoutTests/fast/forms/label/label-contains-other-interactive-content.html ('k') | Source/core/html/HTMLAudioElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698