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

Unified Diff: third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp

Issue 2011653003: Only allow link clicks on single click. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test and adjust comment Created 4 years, 7 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: third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp b/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp
index e7fc3dcbed2fa990f66309af0a2e7c3123fe718c..054765a1ab488fb6b3b79eaeaebd8b1eea2ef90a 100644
--- a/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp
@@ -373,7 +373,8 @@ bool isEnterKeyKeydownEvent(Event* event)
bool isLinkClick(Event* event)
{
- return event->type() == EventTypeNames::click && (!event->isMouseEvent() || toMouseEvent(event)->button() != RightButton);
+ // Allow detail <= 1 so that synthetic clicks work. They may have detail == 0.
+ return event->type() == EventTypeNames::click && (!event->isMouseEvent() || (toMouseEvent(event)->button() != RightButton && toMouseEvent(event)->detail() <= 1));
}
bool HTMLAnchorElement::willRespondToMouseClickEvents()

Powered by Google App Engine
This is Rietveld 408576698