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

Unified Diff: WebCore/html/HTMLInputElement.cpp

Issue 3325025: Merge 67261 - Make middle clicks not fire DOM onclick events.... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/517/
Patch Set: Created 10 years, 3 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 | « WebCore/html/HTMLAnchorElement.cpp ('k') | WebCore/page/EventHandler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/html/HTMLInputElement.cpp
===================================================================
--- WebCore/html/HTMLInputElement.cpp (revision 67262)
+++ WebCore/html/HTMLInputElement.cpp (working copy)
@@ -2146,16 +2146,13 @@
, m_checked(checked) { }
};
-void* HTMLInputElement::preDispatchEventHandler(Event *evt)
+void* HTMLInputElement::preDispatchEventHandler(Event* evt)
{
// preventDefault or "return false" are used to reverse the automatic checking/selection we do here.
// This result gives us enough info to perform the "undo" in postDispatch of the action we take here.
void* result = 0;
- if ((inputType() == CHECKBOX || inputType() == RADIO) && evt->isMouseEvent()
- && evt->type() == eventNames().clickEvent && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
-
+ if ((inputType() == CHECKBOX || inputType() == RADIO) && evt->type() == eventNames().clickEvent) {
OwnPtr<EventHandlingState> state = adoptPtr(new EventHandlingState(indeterminate(), checked()));
-
if (inputType() == CHECKBOX) {
if (indeterminate())
setIndeterminate(false);
@@ -2183,8 +2180,7 @@
void HTMLInputElement::postDispatchEventHandler(Event *evt, void* data)
{
- if ((inputType() == CHECKBOX || inputType() == RADIO) && evt->isMouseEvent()
- && evt->type() == eventNames().clickEvent && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
+ if ((inputType() == CHECKBOX || inputType() == RADIO) && evt->type() == eventNames().clickEvent) {
if (EventHandlingState* state = reinterpret_cast<EventHandlingState*>(data)) {
if (inputType() == CHECKBOX) {
@@ -2267,10 +2263,7 @@
return;
}
- if (inputType() == RADIO
- && evt->isMouseEvent()
- && evt->type() == eventNames().clickEvent
- && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
+ if (inputType() == RADIO && evt->type() == eventNames().clickEvent) {
evt->setDefaultHandled();
return;
}
« no previous file with comments | « WebCore/html/HTMLAnchorElement.cpp ('k') | WebCore/page/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698