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

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

Issue 2833313003: Pass clickEvent to controlElement inside label if targetNode can't start selection (Closed)
Patch Set: patch set updated Created 3 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp b/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
index 06670f2cf1a1c1623ce571f30741bf5481761a0d..9ce1de6e51058a6aea6d1c3d6cd5892e2e15abe3 100644
--- a/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
@@ -163,7 +163,8 @@ void HTMLLabelElement::DefaultEventHandler(Event* evt) {
// click event to control element.
// Note: check if it is a MouseEvent because a click event may
// not be an instance of a MouseEvent if created by document.createEvent().
- if (evt->IsMouseEvent() && ToMouseEvent(evt)->HasPosition()) {
+ if (evt->IsMouseEvent() && ToMouseEvent(evt)->HasPosition() &&
+ isHTMLLabelElement(evt->target()->ToNode())) {
yosin_UTC9 2017/05/09 00:56:06 I think we should check Event#srcElement in select
tkent 2017/05/09 02:14:26 Does this work if <label> has a child element? e.
tanvir 2017/05/09 12:02:32 1) On using the label element as below <label><in
tanvir 2017/05/10 13:44:36 Hi Yosin, I couldn't get what you meant by " we sh
if (LocalFrame* frame = GetDocument().GetFrame()) {
// Check if there is a selection and click is not on the
// selection.
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698