OSDN Git Service

Fix the mouse handling for the video control
authorTeng-Hui Zhu <ztenghui@google.com>
Mon, 22 Aug 2011 18:27:10 +0000 (11:27 -0700)
committerTeng-Hui Zhu <ztenghui@google.com>
Mon, 22 Aug 2011 18:32:36 +0000 (11:32 -0700)
bug:5137664
Change-Id: I0f2b1a84beebe03d4282e728bb26ec70d05bf813

Source/WebCore/html/HTMLMediaElement.cpp

index 93bd09e..f4f7002 100644 (file)
@@ -1634,13 +1634,12 @@ void HTMLMediaElement::playbackProgressTimerFired(Timer<HTMLMediaElement>*)
 
     scheduleTimeupdateEvent(true);
     if (hasMediaControls()) {
-
-        if (!m_mouseOver && controls() && hasVideo()) {
 #if PLATFORM(ANDROID)
-            if (WTF::currentTime() - m_lastTouch > TOUCH_DELAY)
+        m_mouseOver = WTF::currentTime() - m_lastTouch <= TOUCH_DELAY;
 #endif
+        if (!m_mouseOver && controls() && hasVideo())
             mediaControls()->makeTransparent();
-        }
+
         mediaControls()->playbackProgressed();
     }
     // FIXME: deal with cue ranges here
@@ -2374,6 +2373,9 @@ void HTMLMediaElement::defaultEventHandler(Event* event)
         widget->handleEvent(event);
 #else
     if (event->isMouseEvent()) {
+#if PLATFORM(ANDROID)
+        m_lastTouch = WTF::currentTime();
+#endif
         MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
         if (mouseEvent->relatedTarget() != this) {
             if (event->type() == eventNames().mouseoverEvent) {