Chromium Code Reviews| Index: Source/core/html/shadow/MediaControls.cpp |
| diff --git a/Source/core/html/shadow/MediaControls.cpp b/Source/core/html/shadow/MediaControls.cpp |
| index bd04ac6ae8d41c0d3a59898d537b5670bfb522cc..49c51408b3a3775223b2ac3200bff19b3f30a732 100644 |
| --- a/Source/core/html/shadow/MediaControls.cpp |
| +++ b/Source/core/html/shadow/MediaControls.cpp |
| @@ -435,12 +435,44 @@ void MediaControls::stoppedCasting() |
| m_overlayCastButton->setIsPlayingRemotely(false); |
| } |
| +bool MediaControls::isInactiveElement(Node* node) const |
| +{ |
| + if (node == m_mediaElement |
| + || node == m_textDisplayContainer |
| + || node == m_overlayEnclosure |
| + || node == m_enclosure) |
| + return true; |
| + |
| + return false; |
| +} |
| + |
| void MediaControls::defaultEventHandler(Event* event) |
| { |
| HTMLDivElement::defaultEventHandler(event); |
| m_wasLastEventTouch = event->isTouchEvent() || event->isGestureEvent() |
| || (event->isMouseEvent() && toMouseEvent(event)->fromTouch()); |
| + // Separate tap gestures from mouse clicks unless the tap |
| + // is intended for an input element like a button. |
| + if (event->type() == EventTypeNames::gesturetap) { |
| + Node * targetNode = event->target() ? event->target()->toNode() : nullptr; |
| + if (!targetNode || isInactiveElement(targetNode)) { |
| + // Do not generate mouse events from this tap |
|
philipj_slow
2015/02/11 06:57:38
Is this necessary? How about simply listening to c
|
| + event->preventDefault(); |
|
qinmin
2015/02/11 22:29:12
What if there is a onclick eventhandler on the Med
Tima Vaisburd
2015/02/11 22:48:20
In this case the solution won't work.
We can't sim
philipj_slow
2015/02/12 02:31:20
What causes the pause? Maybe you were testing whil
|
| + |
| + if (!m_panel->isOpaque()) { |
| + makeOpaque(); |
| + startHideMediaControlsTimer(); |
| + // Prevent immediate hiding by playbackProgressed() |
|
philipj_slow
2015/02/11 06:57:38
This seems like a bit of a hack, I think it would
Tima Vaisburd
2015/02/12 03:18:02
Yes, I agree, but so far I haven;t come up with a
|
| + m_isMouseOverControls = true; |
| + } else { |
| + stopHideMediaControlsTimer(); |
| + makeTransparent(); |
| + } |
| + } |
| + return; |
| + } |
| + |
| if (event->type() == EventTypeNames::mouseover) { |
| if (!containsRelatedTarget(event)) { |
| m_isMouseOverControls = true; |