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

Side by Side Diff: Source/core/events/EventDispatcher.cpp

Issue 291563009: Don't repaint button when its click() method is called (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: NeedsRebaseline on mac Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/repaint/button-checkbox-click-method-repaint-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 if (!gNodesDispatchingSimulatedClicks) 80 if (!gNodesDispatchingSimulatedClicks)
81 gNodesDispatchingSimulatedClicks = new HashSet<Node*>; 81 gNodesDispatchingSimulatedClicks = new HashSet<Node*>;
82 else if (gNodesDispatchingSimulatedClicks->contains(node)) 82 else if (gNodesDispatchingSimulatedClicks->contains(node))
83 return; 83 return;
84 84
85 gNodesDispatchingSimulatedClicks->add(node); 85 gNodesDispatchingSimulatedClicks->add(node);
86 86
87 if (mouseEventOptions == SendMouseOverUpDownEvents) 87 if (mouseEventOptions == SendMouseOverUpDownEvents)
88 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::mouseo ver, node->document().domWindow(), underlyingEvent)).dispatch(); 88 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::mouseo ver, node->document().domWindow(), underlyingEvent)).dispatch();
89 89
90 if (mouseEventOptions != SendNoEvents) 90 if (mouseEventOptions != SendNoEvents) {
91 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::moused own, node->document().domWindow(), underlyingEvent)).dispatch(); 91 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::moused own, node->document().domWindow(), underlyingEvent)).dispatch();
92 node->setActive(true); 92 node->setActive(true);
93 if (mouseEventOptions != SendNoEvents)
94 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::mouseu p, node->document().domWindow(), underlyingEvent)).dispatch(); 93 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::mouseu p, node->document().domWindow(), underlyingEvent)).dispatch();
94 }
95 // Some elements (e.g. the color picker) may set active state to true before
96 // calling this method and expect the state to be reset during the call.
95 node->setActive(false); 97 node->setActive(false);
96 98
97 // always send click 99 // always send click
98 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::click, nod e->document().domWindow(), underlyingEvent)).dispatch(); 100 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::click, nod e->document().domWindow(), underlyingEvent)).dispatch();
99 101
100 gNodesDispatchingSimulatedClicks->remove(node); 102 gNodesDispatchingSimulatedClicks->remove(node);
101 } 103 }
102 104
103 bool EventDispatcher::dispatch() 105 bool EventDispatcher::dispatch()
104 { 106 {
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 225 }
224 } 226 }
225 } 227 }
226 228
227 const NodeEventContext* EventDispatcher::topNodeEventContext() 229 const NodeEventContext* EventDispatcher::topNodeEventContext()
228 { 230 {
229 return m_event->eventPath().isEmpty() ? 0 : &m_event->eventPath().last(); 231 return m_event->eventPath().isEmpty() ? 0 : &m_event->eventPath().last();
230 } 232 }
231 233
232 } 234 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/repaint/button-checkbox-click-method-repaint-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698