Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(903)

Unified Diff: Source/core/html/HTMLMediaElement.cpp

Issue 830183005: Re-enable the activation behavior of media elements (click to play/pause) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: simplify test Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index cfb07c3d6bee971bd25d6e314ceadfb038495f74..2abdc36a09c964a95c2230743f09eb291c2339ff 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -4041,12 +4041,24 @@ bool HTMLMediaElement::isInteractiveContent() const
return fastHasAttribute(controlsAttr);
}
+bool HTMLMediaElement::willRespondToMouseClickEvents()
+{
+ return fastHasAttribute(controlsAttr);
+}
+
void HTMLMediaElement::defaultEventHandler(Event* event)
{
+ if (event->type() == EventTypeNames::click && willRespondToMouseClickEvents()) {
+ togglePlayState();
+ event->setDefaultHandled();
+ return;
+ }
+
if (event->type() == EventTypeNames::focusin) {
if (hasMediaControls())
mediaControls()->mediaElementFocused();
}
+
HTMLElement::defaultEventHandler(event);
}

Powered by Google App Engine
This is Rietveld 408576698