New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 737452 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug

Blocked on:
issue 290466



Sign in to add a comment

Incorrect behavior of "cursor: auto" over form controls

Reported by friv...@gmail.com, Jun 28 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:54.0) Gecko/20100101 Firefox/54.0

Steps to reproduce the problem:
Open https://test.csswg.org/harness/test/css-ui-3_dev/single/cursor-auto-005/format/html5/

What is the expected behavior?

What went wrong?

The "auto" behavior of the "cursor" property used to be only vaguely defined, but to improve interoperability, the latest specification[1] is more clear:

> auto behaves as 'text' over text, and 'default' otherwise.

Other expected effects, such as the cursor changes over form controls should be achieved using the UA stylesheet, rather than through the magic behavior of the "auto" value.

Chrome uses "auto" rather than the UA stylesheet to adjust the cursor, which causes the test mentioned above to fail.

[1] https://drafts.csswg.org/css-ui-3/#valdef-cursor-auto

Did this work before? No 

Does this work in other browsers? N/A

Chrome version: 61  Channel: canary
OS Version: OS X 10.11
Flash Version:
 
Components: Blink>Input
Status: Untriaged (was: Unconfirmed)
Confirmed test failure on Linux Chrome 59, 60 and 61.
Labels: Needs-Triage-M61
Components: -Blink>Input UI>Input Blink>Editing
Labels: -OS-Mac OS-All

Comment 4 by yosin@chromium.org, Jun 30 2017

Components: -UI>Input -Blink>Editing Blink>Input
Change to Blink>Input

Cursor shape is determined by EventHandler::SelectCursor().
For "cursor:auto", it is done by EventHandler::SelectAutoCursor()
Cc: nzolghadr@chromium.org
Labels: -Pri-2 Hotlist-Input-Dev Pri-3
Owner: eirage@chromium.org
Status: Assigned (was: Untriaged)

Comment 6 by eirage@chromium.org, Jul 14 2017

Cc: ananta@chromium.org eirage@chromium.org
 Issue 737458  has been merged into this issue.
Blockedon: 290466

Comment 8 by friv...@gmail.com, Sep 6 2017

A couple of questions on this topic were raised (by eirage) to the CSS-WG on this topic, and have been resolved. The current ED (https://drafts.csswg.org/css-ui-3/#cursor) is up to date and reflects that.

Do you have any additional question or concern, or can this go ahead?
frivoal@, thanks for resolved my questions, sorry that I didn't reply to you on time. I have a cl for this issue waiting for owner's opinion and review. 
Project Member

Comment 10 by bugdroid1@chromium.org, Sep 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/53a46aede88dac4189a493f1e6eb30868aa17929

commit 53a46aede88dac4189a493f1e6eb30868aa17929
Author: Ella Ge <eirage@chromium.org>
Date: Tue Sep 12 16:07:13 2017

Change Cursor behavior to match spec

spec: https://drafts.csswg.org/css-ui-3/#cursor

1. When cursor:auto, cursor should be "text" over selectable text,
default otherwise.
Changed SelectAutoCursor and ShouldShowIBeamForNode to match spec.
Use UA stylesheet to achieve different cursor on different element.
(browser default behavior)

2. When cursor:text, use VerticalTextCursor when vertical-text.

3. Show pointer cursor when mouse hovering resizers no matter what
 cursor style set for its owner element.

4. When selecting anchor text, use I-beam when style cursor:pointer,
otherwise keep style cursor.


Bug:  737452 
Change-Id: I71e0a63b1518cde261755c9339eb62f8e3e2c21f
Reviewed-on: https://chromium-review.googlesource.com/600252
Commit-Queue: Ella Ge <eirage@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Navid Zolghadr <nzolghadr@chromium.org>
Reviewed-by: nainar <nainar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501293}
[modify] https://crrev.com/53a46aede88dac4189a493f1e6eb30868aa17929/third_party/WebKit/Source/core/css/html.css
[modify] https://crrev.com/53a46aede88dac4189a493f1e6eb30868aa17929/third_party/WebKit/Source/core/css/themeInputMultipleFields.css
[modify] https://crrev.com/53a46aede88dac4189a493f1e6eb30868aa17929/third_party/WebKit/Source/core/input/EventHandler.cpp
[modify] https://crrev.com/53a46aede88dac4189a493f1e6eb30868aa17929/third_party/WebKit/Source/core/input/EventHandler.h

Cc: pnangunoori@chromium.org
Labels: Needs-Feedback
Tested the issue on Windows-10, Mac 10.12.6 and Ubuntu 14.04 using chrome  #59.0.3071.115, M-60 #60.0.3112.72, latest Stable #61.0.3163.79 and latest Canary M63-63.0.3214.0 by following steps mentioned in the original comment and in the test link provided and unable to reproduce the issue.

Not adding TE-Verified label as behavior seems to be same M-59, M-60, M-63 builds and Firefox as well.

Please refer the screencast attached.

@eirage -- could you please let us know what exact is change landed in the latest build.

Thank you!
737452.webm
3.9 MB View Download
Tested the issue on Windows-10, Mac 10.12.6 and Ubuntu 14.04 using chrome  #59.0.3071.115, M-60 #60.0.3112.72, latest Stable #61.0.3163.79 and latest Canary M63-63.0.3214.0 by following steps mentioned in the original comment and in the test link provided and unable to reproduce the issue.

Not adding TE-Verified label as behavior seems to be same M-59, M-60, M-63 builds and Firefox as well.

Please refer the screencast attached.

@eirage -- could you please let us know what exact is change landed in the latest build.

Thank you!
737452.webm
3.9 MB View Download
@pnangunoori, the landed change change the UA stylesheet for input/textarea element and link not use "cursor:auto". and keep the behavior same.

The change should be visible from developer tool as attached screenshot:
"input" element cursor property in User agent style sheet changed from auto to text
"textarea" and "webkit-any-link" changed to text and pointer.

The cursor behavior of "cursor:auto" on "input" and "textarea" element are not changed in this patch. 
The merged issue  crbug.com/737458  has changed. (cursor over link changed from hand cursor to I-beam cursor)

61.png
48.5 KB View Download
new.png
45.1 KB View Download
Labels: TE-Verified-M63 TE-Verified-63.0.3214.0
Tested the issue on Windows7, Mac 10.12.6 and Ubuntu 14.04 using Chrome version M63 - 63.0.3214.0 as per the issue mentioned in original comment and the merged  Issue 737458 . Observed that issue is working as intended ("cursor" value for "textarea", "textfield" and "webkit-any-link" changed to text and pointer respectively). Hence adding TE-Verified label. Attached the screenshot for reference.

Links for reference:
https://test.csswg.org/harness/test/css-ui-3_dev/single/cursor-auto-005/format/html5/
https://test.csswg.org/harness/test/css-ui-3_dev/single/cursor-auto-002/format/html5/

Thank you!
737452.png
430 KB View Download
Labels: -TE-Verified-M63 -TE-Verified-63.0.3214.0
The cursor behavior of "cursor:auto" on "input" and "textarea" element are not changed in this patch. Hence, removing the TE-Verified labels.

Comment 16 by friv...@gmail.com, Sep 14 2017

Testing with build 63.0.3215.0 on OS X.

cursor-auto-003 now passes. Nice!

In cursor-auto-002, when hovering over the link, the cursor is no longer the "pointer" hand shape, but instead of being the I-beam you'd expect over text, it is the "default" arrow shape.

In cursor-auto-005, the appearance of the "auto" cursor over an empty (i.e. without text) input and text area are still I-beam, rather the "default" arrow shape.
Sorry for cursor-auto-002, I'll fix it really quick.

For cursor-auto-005, I'm not able to achieve the behavior of "I-Beam when hovering text inside input" in current code. And also since there is no other browser doing as the expect behavior, we'll keep it as I-beam for now.

Comment 18 by friv...@gmail.com, Sep 16 2017

Could you elaborate a bit why 005 isn't doable? I thought this might be because the form controls are rendered with native elements, but since applying -webkit-appearance:none makes no difference, that's presumably not the case.
Project Member

Comment 19 by bugdroid1@chromium.org, Sep 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/74ef53b06b1e1f1e775371296c3457f54a2b9eba

commit 74ef53b06b1e1f1e775371296c3457f54a2b9eba
Author: Ella Ge <eirage@chromium.org>
Date: Fri Sep 22 15:22:48 2017

fix: cursor:auto over link should show Ibeam.

This cl fix an incorrect behavior made in
When cursor:auto, should show Ibeam when hovering anchor text.

https: //chromium-review.googlesource.com/c/chromium/src/+/600252
Bug:  737452 
Change-Id: Ibcd74d76018f6e12c5372cb9e2194460d77c02e5
Reviewed-on: https://chromium-review.googlesource.com/668958
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Ella Ge <eirage@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503742}
[modify] https://crrev.com/74ef53b06b1e1f1e775371296c3457f54a2b9eba/third_party/WebKit/Source/core/input/EventHandler.cpp
[modify] https://crrev.com/74ef53b06b1e1f1e775371296c3457f54a2b9eba/third_party/WebKit/Source/core/input/EventHandler.h
[modify] https://crrev.com/74ef53b06b1e1f1e775371296c3457f54a2b9eba/third_party/WebKit/Source/core/input/EventHandlerTest.cpp

Comment 20 by friv...@gmail.com, Sep 26 2017

I confirmed the latest patch solves cursor-auto-002. Thanks.

As for cursor-auto-005, I'd like to know more about why this is hard to fix, so that I can see if it is better to just wait, or if we should consider having another look at the spec.
For cursor-auto-005, the major concern for us is there is no other browser doing as the new spec proposed.

For the "hard to fix" part, I figured that out recently. Some aging code cause it only returns the container element when hit inside the input box. therefore we can't tell cursor is on text or empty inbox.
I'll have a patch send for review in next few day. If other folks think it's safe to change it then we can proceed.

Could you wait for a few days for the reviews?


Project Member

Comment 22 by bugdroid1@chromium.org, Oct 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/902ef4e53edcb011944f0f7cc3cd9a7d43b21759

commit 902ef4e53edcb011944f0f7cc3cd9a7d43b21759
Author: Ella Ge <eirage@chromium.org>
Date: Fri Oct 13 07:12:34 2017

editable links show text cursor

When hovering editable links, should show text cursor to show
information about editablity.

Add a:-webkit-any-link:read-write { cursor: text} in UA stylesheet

This matches what Firefox do.

Bug:  774058 ,  737452 
Change-Id: Id6fe4fcdf55dd22e7c320734fc8682a289d7e8c7
Reviewed-on: https://chromium-review.googlesource.com/716317
Reviewed-by: Navid Zolghadr <nzolghadr@chromium.org>
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Ella Ge <eirage@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508630}
[modify] https://crrev.com/902ef4e53edcb011944f0f7cc3cd9a7d43b21759/third_party/WebKit/Source/core/css/html.css

Status: Fixed (was: Assigned)
Close this issue since spec is changed to 
"auto: The UA determines the cursor to display based on the current context, specifically: auto behaves as text over selectable text *or editable elements*, and default otherwise."

CL landed above fixed the behavior of "Chrome uses "auto" rather than the UA stylesheet to adjust the cursor"
We don't need to fix behavior in cursor-auto-005(input box&text area) anymore.

Comment 24 by friv...@gmail.com, Oct 22 2017

Thanks for the adjustments. As far as the tests can tell, Chrome, Firefox, and the spec are now in agreement, with Edge having expressed that they were working on aligning as well.

Sign in to add a comment