| Index: Source/core/html/HTMLMediaElement.cpp
|
| diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
|
| index 35f8cd734ac77d7fa55aba347ec080f1add8dda1..5e946c6bda1f172b9a1c0f8f87594a55ab4f2619 100644
|
| --- a/Source/core/html/HTMLMediaElement.cpp
|
| +++ b/Source/core/html/HTMLMediaElement.cpp
|
| @@ -410,7 +410,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 shouldDisplayControls() || HTMLElement::supportsFocus();
|
| }
|
|
|
| bool HTMLMediaElement::isMouseFocusable() const
|
| @@ -468,7 +468,7 @@ void HTMLMediaElement::finishParsingChildren()
|
|
|
| bool HTMLMediaElement::rendererIsNeeded(const RenderStyle& style)
|
| {
|
| - return controls() ? HTMLElement::rendererIsNeeded(style) : false;
|
| + return shouldDisplayControls() ? HTMLElement::rendererIsNeeded(style) : false;
|
| }
|
|
|
| RenderObject* HTMLMediaElement::createRenderer(RenderStyle*)
|
| @@ -2297,6 +2297,11 @@ void HTMLMediaElement::setLoop(bool b)
|
|
|
| bool HTMLMediaElement::controls() const
|
| {
|
| + return fastHasAttribute(controlsAttr);
|
| +}
|
| +
|
| +bool HTMLMediaElement::shouldDisplayControls() const
|
| +{
|
| LocalFrame* frame = document().frame();
|
|
|
| // always show controls when scripting is disabled
|
| @@ -2307,7 +2312,7 @@ bool HTMLMediaElement::controls() const
|
| if (isFullscreen())
|
| return true;
|
|
|
| - return fastHasAttribute(controlsAttr);
|
| + return controls();
|
| }
|
|
|
| void HTMLMediaElement::setControls(bool b)
|
| @@ -3586,7 +3591,7 @@ bool HTMLMediaElement::createMediaControls()
|
|
|
| ensureUserAgentShadowRoot().appendChild(mediaControls);
|
|
|
| - if (!controls() || !inDocument())
|
| + if (!shouldDisplayControls() || !inDocument())
|
| mediaControls->hide();
|
|
|
| return true;
|
| @@ -3594,7 +3599,7 @@ bool HTMLMediaElement::createMediaControls()
|
|
|
| void HTMLMediaElement::configureMediaControls()
|
| {
|
| - if (!controls() || !inDocument()) {
|
| + if (!shouldDisplayControls() || !inDocument()) {
|
| if (hasMediaControls())
|
| mediaControls()->hide();
|
| return;
|
|
|