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

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

Issue 351213007: Ensure that the controls attribute is correctly reflected in JS. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: REbase Created 6 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/HTMLMediaElement.h ('k') | Source/core/html/HTMLMediaElement.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index fc8703819fa07c010facb070678d03f1f8120be2..265d923d7e92592bb09e59228e245c14ec366a87 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -481,7 +481,7 @@ bool HTMLMediaElement::supportsFocus() const
return false;
// If no controls specified, we should still be able to focus the element if it has tabIndex.
- return controls() || HTMLElement::supportsFocus();
+ return shouldShowControls() || HTMLElement::supportsFocus();
}
bool HTMLMediaElement::isMouseFocusable() const
@@ -531,7 +531,7 @@ void HTMLMediaElement::finishParsingChildren()
bool HTMLMediaElement::rendererIsNeeded(const RenderStyle& style)
{
- return controls() ? HTMLElement::rendererIsNeeded(style) : false;
+ return shouldShowControls() && HTMLElement::rendererIsNeeded(style);
}
RenderObject* HTMLMediaElement::createRenderer(RenderStyle*)
@@ -2252,7 +2252,7 @@ void HTMLMediaElement::setLoop(bool b)
setBooleanAttribute(loopAttr, b);
}
-bool HTMLMediaElement::controls() const
+bool HTMLMediaElement::shouldShowControls() const
{
LocalFrame* frame = document().frame();
@@ -2267,12 +2267,6 @@ bool HTMLMediaElement::controls() const
return fastHasAttribute(controlsAttr);
}
-void HTMLMediaElement::setControls(bool b)
-{
- WTF_LOG(Media, "HTMLMediaElement::setControls(%s)", boolString(b));
- setBooleanAttribute(controlsAttr, b);
-}
-
double HTMLMediaElement::volume() const
{
return m_volume;
@@ -3599,7 +3593,7 @@ bool HTMLMediaElement::createMediaControls()
ensureUserAgentShadowRoot().appendChild(mediaControls);
- if (!controls() || !inDocument())
+ if (!shouldShowControls() || !inDocument())
mediaControls->hide();
return true;
@@ -3607,7 +3601,7 @@ bool HTMLMediaElement::createMediaControls()
void HTMLMediaElement::configureMediaControls()
{
- if (!controls() || !inDocument()) {
+ if (!shouldShowControls() || !inDocument()) {
if (hasMediaControls())
mediaControls()->hide();
return;
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | Source/core/html/HTMLMediaElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698