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

Issue 2833313003: Pass clickEvent to controlElement inside label if targetNode can't start selection (Closed)

Created:
3 years, 8 months ago by tanvir
Modified:
3 years, 7 months ago
CC:
chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Pass clickEvent to controlElement inside label if target node can't start selection. On selection of any text in the HTML content, if any of the image in a label is clicked, radio input is not selected. This CL fixes this issue, the click events were not getting passed to the control elements, as for few elements like image, update selection is not done on single click as |CanMouseDownStartSelect()| returns false. So this CL checks whether a selection could be done on an element inside label. BUG=637516 TEST=run_layout_test fast/forms/label/label-selection-by-textSelection-and-click.html Review-Url: https://codereview.chromium.org/2833313003 Cr-Commit-Position: refs/heads/master@{#473151} Committed: https://chromium.googlesource.com/chromium/src/+/5db23fe6d7151affeaf8b84ac2b16cf1603c456d

Patch Set 1 : Patch Set1 #

Patch Set 2 : Added LayoutTestCase #

Total comments: 16

Patch Set 3 : Review Comments updated #

Total comments: 7

Patch Set 4 : patch set updated #

Total comments: 4

Patch Set 5 : updated Patch #

Total comments: 8

Patch Set 6 : Address Review Comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -1 line) Patch
A third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html View 1 2 3 4 5 1 chunk +44 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLLabelElement.cpp View 1 2 4 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 57 (36 generated)
tanvir
The issue scenario is as below. There is a text Element, followed by a label ...
3 years, 8 months ago (2017-04-24 07:13:38 UTC) #3
Srirama
Peer review is fine, lets get the opinion from module owners.
3 years, 8 months ago (2017-04-24 12:43:18 UTC) #13
tanvir
Hi Yosin, PTAL! I have mentioned complete details as why i added this check in ...
3 years, 8 months ago (2017-04-24 13:41:30 UTC) #16
yosin_UTC9
- Could you start description with summary? - Could you make summary to describe what ...
3 years, 8 months ago (2017-04-25 07:14:20 UTC) #17
tanvir
On 2017/04/25 07:14:20, yosin_UTC9 wrote: > - Could you start description with summary? > - ...
3 years, 8 months ago (2017-04-25 07:47:30 UTC) #19
yosin_UTC9
Could you add test to verify this patch fix the issue and to avoid regression ...
3 years, 8 months ago (2017-04-25 08:04:46 UTC) #20
tanvir
Added layoutTest case. PTAL! Thanks
3 years, 7 months ago (2017-04-28 09:32:16 UTC) #21
Srirama
https://codereview.chromium.org/2833313003/diff/20001/third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html File third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html (right): https://codereview.chromium.org/2833313003/diff/20001/third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html#newcode4 third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html:4: <p id="textId">Selected Text</p> you can remove id here and ...
3 years, 7 months ago (2017-04-28 12:56:45 UTC) #22
tanvir
PS updated for review comments. PTAL!!! https://codereview.chromium.org/2833313003/diff/20001/third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html File third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html (right): https://codereview.chromium.org/2833313003/diff/20001/third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html#newcode4 third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html:4: <p id="textId">Selected Text</p> ...
3 years, 7 months ago (2017-05-02 10:02:51 UTC) #23
Srirama
Peer review is fine
3 years, 7 months ago (2017-05-02 11:21:40 UTC) #24
yosin_UTC9
https://codereview.chromium.org/2833313003/diff/40001/third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html File third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html (right): https://codereview.chromium.org/2833313003/diff/40001/third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html#newcode13 third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html:13: var radio = label.querySelector("input[name=a]"); nit: better to use 'input[type=radio]'. ...
3 years, 7 months ago (2017-05-08 03:25:56 UTC) #29
tanvir
Should we check whether Event#srcElement is LABEL element or not? Yes i updated code to ...
3 years, 7 months ago (2017-05-08 14:02:52 UTC) #30
yosin_UTC9
+tkent@ for Form control experts https://codereview.chromium.org/2833313003/diff/60001/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp File third_party/WebKit/Source/core/html/HTMLLabelElement.cpp (right): https://codereview.chromium.org/2833313003/diff/60001/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp#newcode167 third_party/WebKit/Source/core/html/HTMLLabelElement.cpp:167: isHTMLLabelElement(evt->target()->ToNode())) { I think ...
3 years, 7 months ago (2017-05-09 00:56:06 UTC) #32
tkent
https://codereview.chromium.org/2833313003/diff/60001/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp File third_party/WebKit/Source/core/html/HTMLLabelElement.cpp (right): https://codereview.chromium.org/2833313003/diff/60001/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp#newcode167 third_party/WebKit/Source/core/html/HTMLLabelElement.cpp:167: isHTMLLabelElement(evt->target()->ToNode())) { Does this work if <label> has a ...
3 years, 7 months ago (2017-05-09 02:14:26 UTC) #35
tanvir
https://codereview.chromium.org/2833313003/diff/60001/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp File third_party/WebKit/Source/core/html/HTMLLabelElement.cpp (right): https://codereview.chromium.org/2833313003/diff/60001/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp#newcode167 third_party/WebKit/Source/core/html/HTMLLabelElement.cpp:167: isHTMLLabelElement(evt->target()->ToNode())) { On 2017/05/09 02:14:26, tkent wrote: > Does ...
3 years, 7 months ago (2017-05-09 12:02:32 UTC) #38
tanvir
PTAL! Since IsHTMLLabelElement has some issues, i am using canStartSelection() logic here. Thanks. https://codereview.chromium.org/2833313003/diff/60001/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp File ...
3 years, 7 months ago (2017-05-10 13:44:36 UTC) #39
tkent
CanStartSelection() looks reasonable to me. https://codereview.chromium.org/2833313003/diff/80001/third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html File third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html (right): https://codereview.chromium.org/2833313003/diff/80001/third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html#newcode12 third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html:12: var label = document.querySelector("label"); ...
3 years, 7 months ago (2017-05-11 06:35:10 UTC) #40
tanvir
PTAL. Thanks https://codereview.chromium.org/2833313003/diff/80001/third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html File third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html (right): https://codereview.chromium.org/2833313003/diff/80001/third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html#newcode12 third_party/WebKit/LayoutTests/fast/forms/label/label-selection-by-textSelection-and-click.html:12: var label = document.querySelector("label"); On 2017/05/11 06:35:10, ...
3 years, 7 months ago (2017-05-11 11:47:52 UTC) #41
tkent
lgtm. Please fix the CL description. The following words look like proper nouns, but they ...
3 years, 7 months ago (2017-05-12 00:57:07 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2833313003/100001
3 years, 7 months ago (2017-05-19 07:07:27 UTC) #54
commit-bot: I haz the power
3 years, 7 months ago (2017-05-19 10:46:55 UTC) #57
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/5db23fe6d7151affeaf8b84ac2b1...

Powered by Google App Engine
This is Rietveld 408576698