Index: Source/core/html/HTMLLabelElement.cpp |
diff --git a/Source/core/html/HTMLLabelElement.cpp b/Source/core/html/HTMLLabelElement.cpp |
index b625e78f6d1c03e85537220ce833a8da5c2d4f3e..fe95b1ba3b016f12383de61b4e76e1ef704d2936 100644 |
--- a/Source/core/html/HTMLLabelElement.cpp |
+++ b/Source/core/html/HTMLLabelElement.cpp |
@@ -28,7 +28,7 @@ |
#include "HTMLNames.h" |
#include "core/dom/ElementTraversal.h" |
#include "core/editing/FrameSelection.h" |
-#include "core/events/Event.h" |
+#include "core/events/MouseEvent.h" |
#include "core/frame/LocalFrame.h" |
#include "core/html/FormAssociatedElement.h" |
@@ -138,9 +138,9 @@ void HTMLLabelElement::defaultEventHandler(Event* evt) |
static bool processingClick = false; |
if (evt->type() == EventTypeNames::click && !processingClick) { |
- // If text of label element is selected, do not pass |
+ // If the click is not simulated and the text of label element is selected, do not pass |
tkent
2014/05/21 00:35:49
nit: Please wrap a comment line in 80-columns.
Xianzhu
2014/05/21 15:58:53
Done.
|
// the event to control element. |
- if (document().frame()->selection().selection().isRange()) |
+ if (!static_cast<MouseEvent*>(evt)->isSimulated() && document().frame()->selection().selection().isRange()) |
tkent
2014/05/21 00:35:49
Pease use toMouseEvent(evt) instead of static_cast
Xianzhu
2014/05/21 15:58:53
Done.
|
return; |
RefPtrWillBeRawPtr<HTMLElement> element = control(); |