summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/rendering/RenderMedia.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering/RenderMedia.cpp')
-rw-r--r--Source/WebCore/rendering/RenderMedia.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/Source/WebCore/rendering/RenderMedia.cpp b/Source/WebCore/rendering/RenderMedia.cpp
index f59a995..0b913ee 100644
--- a/Source/WebCore/rendering/RenderMedia.cpp
+++ b/Source/WebCore/rendering/RenderMedia.cpp
@@ -39,7 +39,8 @@
#include <wtf/CurrentTime.h>
#include <wtf/MathExtras.h>
-#if PLATFORM(ANDROID)
+#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
+#include "TouchEvent.h"
#define TOUCH_DELAY 4
#endif
@@ -467,7 +468,7 @@ void RenderMedia::updateControlVisibility()
if (style()->visibility() != VISIBLE)
return;
-#if PLATFORM(ANDROID)
+#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
if (WTF::currentTime() - m_lastTouch > TOUCH_DELAY)
m_mouseOver = false;
else
@@ -631,6 +632,20 @@ void RenderMedia::forwardEvent(Event* event)
updateControlVisibility();
}
}
+#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
+ // We want to process touch events landing on the timeline so that the user
+ // can drag the scrollbar thumb with their finger.
+ else if (event->isTouchEvent() && m_controlsShadowRoot) {
+ TouchEvent* touchEvent = static_cast<TouchEvent*>(event);
+ if (touchEvent->touches() && touchEvent->touches()->item(0)) {
+ IntPoint point;
+ point.setX(touchEvent->touches()->item(0)->pageX());
+ point.setY(touchEvent->touches()->item(0)->pageY());
+ if (m_timeline && m_timeline->hitTest(point))
+ m_timeline->defaultEventHandler(event);
+ }
+ }
+#endif
}
// We want the timeline slider to be at least 100 pixels wide.