summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/rendering')
-rw-r--r--WebCore/rendering/RenderMedia.cpp24
-rw-r--r--WebCore/rendering/RenderMedia.h3
2 files changed, 26 insertions, 1 deletions
diff --git a/WebCore/rendering/RenderMedia.cpp b/WebCore/rendering/RenderMedia.cpp
index 49a536c..f19ca96 100644
--- a/WebCore/rendering/RenderMedia.cpp
+++ b/WebCore/rendering/RenderMedia.cpp
@@ -39,6 +39,10 @@
#include <wtf/CurrentTime.h>
#include <wtf/MathExtras.h>
+#if PLATFORM(ANDROID)
+#define TOUCH_DELAY 4
+#endif
+
using namespace std;
namespace WebCore {
@@ -57,6 +61,9 @@ RenderMedia::RenderMedia(HTMLMediaElement* video)
, m_opacityAnimationDuration(0)
, m_opacityAnimationFrom(0)
, m_opacityAnimationTo(1.0f)
+#if PLATFORM(ANDROID)
+ , m_lastTouch(0)
+#endif
{
setImageResource(RenderImageResource::create());
}
@@ -70,6 +77,9 @@ RenderMedia::RenderMedia(HTMLMediaElement* video, const IntSize& intrinsicSize)
, m_opacityAnimationDuration(0)
, m_opacityAnimationFrom(0)
, m_opacityAnimationTo(1.0f)
+#if PLATFORM(ANDROID)
+ , m_lastTouch(0)
+#endif
{
setImageResource(RenderImageResource::create());
setIntrinsicSize(intrinsicSize);
@@ -456,7 +466,14 @@ void RenderMedia::updateControlVisibility()
// Don't fade if the media element is not visible
if (style()->visibility() != VISIBLE)
return;
-
+
+#if PLATFORM(ANDROID)
+ if (WTF::currentTime() - m_lastTouch > TOUCH_DELAY)
+ m_mouseOver = false;
+ else
+ m_mouseOver = true;
+#endif
+
bool shouldHideController = !m_mouseOver && !media->canPlay();
// Do fading manually, css animations don't work with shadow trees
@@ -535,6 +552,11 @@ void RenderMedia::updateVolumeSliderContainer(bool visible)
void RenderMedia::forwardEvent(Event* event)
{
+#if PLATFORM(ANDROID)
+ if (event->isMouseEvent())
+ m_lastTouch = WTF::currentTime();
+#endif
+
if (event->isMouseEvent() && m_controlsShadowRoot) {
MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
IntPoint point(mouseEvent->absoluteLocation());
diff --git a/WebCore/rendering/RenderMedia.h b/WebCore/rendering/RenderMedia.h
index aa725ff..65fdc7d 100644
--- a/WebCore/rendering/RenderMedia.h
+++ b/WebCore/rendering/RenderMedia.h
@@ -151,6 +151,9 @@ private:
double m_opacityAnimationDuration;
float m_opacityAnimationFrom;
float m_opacityAnimationTo;
+#if PLATFORM(ANDROID)
+ double m_lastTouch;
+#endif
};
inline RenderMedia* toRenderMedia(RenderObject* object)