Closed Bug 389283 Opened 17 years ago Closed 8 years ago

Text cursor value for cursor:auto depends on (ancestor) tabindex attribute

Categories

(Core :: CSS Parsing and Computation, defect)

x86
Linux
defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)

Details

(Keywords: testcase)

Attachments

(3 files)

Text cursor value for cursor:auto depends on (ancestor) tabindex attribute.
This doesn't seem right to me.

http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/layout/generic/nsTextFrameThebes.cpp&rev=3.54&root=/cvsroot&mark=3439-3454#3431
(it was added by bug 171366)

I think this block should either be removed, or replaced with code
that chooses a cursor based on if the text is selectable or not
(-moz-user-selectable).
Attached file Testcase #1
Attached patch Patch rev. 1Splinter Review
Choose cursor value based on IsSelectable()...
Attachment #273458 - Flags: superreview?(dbaron)
Attachment #273458 - Flags: review?(dbaron)
Comment on attachment 273458 [details] [diff] [review]
Patch rev. 1

This makes much more sense to me than the old code, although I think you should check the style like PeekOffsetWord and PeekOffsetCharacter do (-moz-user-select: all means, I think, that only the whole thing can be selected; see http://www.w3.org/TR/2000/WD-css3-userint-20000216#user-select ).  It's probably worth double-checking that this makes sense given how we actually behave with 'all'.

It looks like this was originally added for bug 171366.
Attachment #273458 - Flags: superreview?(dbaron)
Attachment #273458 - Flags: superreview+
Attachment #273458 - Flags: review?(dbaron)
Attachment #273458 - Flags: review+
So I meet this issue 10 years latter... I don't understand why the patch didn't get landed 10 years ago. It makes lots of sense to me.

For handling of user-select: all, we currently display I-beam for element with that style, and WebKit and Blink do so as well, so I don't think we should change that behavior, even though user can't really select part of the text.
That patch is basically a rebase of that from comment 2. It seems the code doesn't change a lot over the past ten years :)
Comment on attachment 8814087 [details]
Bug 389283 - Choose cursor value based on selectability.

https://reviewboard.mozilla.org/r/95392/#review96222

Tests might not be a bad idea... but r=dbaron.
Attachment #8814087 - Flags: review?(dbaron) → review+
I have no idea how this can be tested...
Pushed by xquan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/756713ac1804
Choose cursor value based on selectability. r=dbaron
https://hg.mozilla.org/mozilla-central/rev/756713ac1804
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: