Index: Source/core/html/shadow/MediaControlElements.cpp |
diff --git a/Source/core/html/shadow/MediaControlElements.cpp b/Source/core/html/shadow/MediaControlElements.cpp |
index 4aeb87a4f86bb20ff86ff545218f831be198d9fc..5474fb758a3b82a88523b2f8b6babbdf3dd7b490 100644 |
--- a/Source/core/html/shadow/MediaControlElements.cpp |
+++ b/Source/core/html/shadow/MediaControlElements.cpp |
@@ -59,6 +59,33 @@ static const AtomicString& getMediaControlTimeRemainingDisplayElementShadowPseud |
static const double fadeInDuration = 0.1; |
static const double fadeOutDuration = 0.3; |
+static bool isUserInteractionEvent(Event* event) |
+{ |
+ const AtomicString& type = event->type(); |
+ return type == EventTypeNames::mousedown |
+ || type == EventTypeNames::mouseup |
+ || type == EventTypeNames::click |
+ || type == EventTypeNames::dblclick |
+ || event->isKeyboardEvent() |
+ || event->isTouchEvent(); |
+} |
+ |
+// Sliders (the volume control and timeline) need to capture some additional events used when dragging the thumb. |
+static bool isUserInteractionEventForSlider(Event* event) |
+{ |
+ const AtomicString& type = event->type(); |
+ return type == EventTypeNames::mousedown |
+ || type == EventTypeNames::mouseup |
+ || type == EventTypeNames::click |
+ || type == EventTypeNames::dblclick |
+ || type == EventTypeNames::mouseover |
+ || type == EventTypeNames::mouseout |
+ || type == EventTypeNames::mousemove |
+ || event->isKeyboardEvent() |
+ || event->isTouchEvent(); |
+} |
+ |
+ |
MediaControlPanelElement::MediaControlPanelElement(MediaControls& mediaControls) |
: MediaControlDivElement(mediaControls, MediaControlsPanel) |
, m_isDisplayed(false) |
@@ -147,6 +174,11 @@ void MediaControlPanelElement::setIsDisplayed(bool isDisplayed) |
m_isDisplayed = isDisplayed; |
} |
+bool MediaControlPanelElement::keepEventInNode(Event* event) |
+{ |
+ return isUserInteractionEvent(event); |
+} |
+ |
// ---------------------------- |
MediaControlPanelEnclosureElement::MediaControlPanelEnclosureElement(MediaControls& mediaControls) |
@@ -295,6 +327,11 @@ const AtomicString& MediaControlOverlayPlayButtonElement::shadowPseudoId() const |
return id; |
} |
+bool MediaControlOverlayPlayButtonElement::keepEventInNode(Event* event) |
+{ |
+ return isUserInteractionEvent(event); |
+} |
+ |
// ---------------------------- |
@@ -408,6 +445,11 @@ const AtomicString& MediaControlTimelineElement::shadowPseudoId() const |
return id; |
} |
+bool MediaControlTimelineElement::keepEventInNode(Event* event) |
+{ |
+ return isUserInteractionEventForSlider(event); |
+} |
+ |
// ---------------------------- |
MediaControlVolumeSliderElement::MediaControlVolumeSliderElement(MediaControls& mediaControls) |
@@ -471,6 +513,11 @@ const AtomicString& MediaControlVolumeSliderElement::shadowPseudoId() const |
return id; |
} |
+bool MediaControlVolumeSliderElement::keepEventInNode(Event* event) |
+{ |
+ return isUserInteractionEventForSlider(event); |
+} |
+ |
// ---------------------------- |
MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement(MediaControls& mediaControls) |