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

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

Issue 829393004: Re-re-enable the activation behavior of media elements (click to play/pause) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Drop the changes to MediaControlOverlayPlayButtonElement and add a 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
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index 447636ba56a17cc7e0bcae0a6463c44e579a7780..bca6511696ee6c0a9059c2c9cafe2b2b41cb9469 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -4025,12 +4025,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);
}
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698