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

Unified Diff: Source/core/html/HTMLAudioElement.cpp

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
« no previous file with comments | « Source/core/html/HTMLAudioElement.h ('k') | Source/core/html/HTMLMediaElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLAudioElement.cpp
diff --git a/Source/core/html/HTMLAudioElement.cpp b/Source/core/html/HTMLAudioElement.cpp
index 6607ab47c103cd41df10c05bcee9e8ff76b21142..4ec5a3c1207f5a440ee843818843d9fc7499cbf5 100644
--- a/Source/core/html/HTMLAudioElement.cpp
+++ b/Source/core/html/HTMLAudioElement.cpp
@@ -57,4 +57,21 @@ PassRefPtrWillBeRawPtr<HTMLAudioElement> HTMLAudioElement::createForJSConstructo
return audio.release();
}
+bool HTMLAudioElement::layoutObjectIsNeeded(const ComputedStyle& style)
+{
+ return shouldShowControls() && HTMLMediaElement::layoutObjectIsNeeded(style);
+}
+
+void HTMLAudioElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
+{
+ if (name == controlsAttr) {
+ if (value.isNull())
+ lazyReattachIfAttached();
+ else
+ setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::fromAttribute(name));
+ }
+
+ HTMLMediaElement::parseAttribute(name, value);
+}
+
}
« no previous file with comments | « Source/core/html/HTMLAudioElement.h ('k') | Source/core/html/HTMLMediaElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698