The default bug view has changed. See this FAQ.

text selection highlighting should paint behind text-shadow

RESOLVED FIXED in mozilla10

Status

()

Core
Layout: Text
RESOLVED FIXED
6 years ago
4 years ago

People

(Reporter: jfkthame, Assigned: jfkthame)

Tracking

(Depends on: 3 bugs)

Trunk
mozilla10
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Assignee)

Description

6 years ago
Currently, it appears that the text-selection highlight is painted on top of any text-shadow in effect. IMO, this makes for a jarring user experience when selecting text that uses shadows. I note that Safari paints the shadow on top of the selection highlight, and I believe this is preferable behavior.

Simple demonstration:
data:text/html,<p style="font-size:40px; text-shadow:2px 2px 1px red;">Hello, shadowed world</p>

Drag back and forth across the text to select/unselect part of it, and note how the shadow is "lost" under the selection highlight. Compare behavior in Safari.
(Assignee)

Comment 1

6 years ago
Created attachment 565577 [details] [diff] [review]
patch, paint text-shadow after selection highlight background

Something like this ought to improve the user experience - seems to work in simple testing, at least, and passes unit tests on try.
Attachment #565577 - Flags: review?(roc)
Comment on attachment 565577 [details] [diff] [review]
patch, paint text-shadow after selection highlight background

Review of attachment 565577 [details] [diff] [review]:
-----------------------------------------------------------------

Reftest? Should at least be able to use a != test
Attachment #565577 - Flags: review?(roc) → review+
(Assignee)

Comment 3

6 years ago
Created attachment 565721 [details] [diff] [review]
reftest for painting selected text with shadow

I think we can test in both != and == forms, by faking the reference rendering using two overlaid divs. Pushed this to tryserver to check that it passes on various platforms (worked ok locally).
Assignee: nobody → jfkthame
Attachment #565721 - Flags: review?(roc)
Attachment #565721 - Flags: review?(roc) → review+
(Assignee)

Comment 4

6 years ago
(In reply to Jonathan Kew (:jfkthame) from comment #3)
> Created attachment 565721 [details] [diff] [review] [diff] [details] [review]
> reftest for painting selected text with shadow
> 
> I think we can test in both != and == forms, by faking the reference
> rendering using two overlaid divs. Pushed this to tryserver to check that it
> passes on various platforms (worked ok locally).

Hmm, the == test fails on platforms where the text color is automagically changed to white when selected. Making the text explicitly "color:white" solves this. Re-running tryserver job to verify there are no other surprises.
(Assignee)

Comment 5

6 years ago
Created attachment 565743 [details] [diff] [review]
reftest v2 - updated to use white text

Updated to use color:white; now passes on all platforms. Carrying forward r=roc.
Attachment #565721 - Attachment is obsolete: true
Attachment #565743 - Flags: review+
(Assignee)

Comment 6

6 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/b87e8e7e7916 (patch)
https://hg.mozilla.org/integration/mozilla-inbound/rev/bd5f05cdf119 (reftest)
Target Milestone: --- → mozilla10
https://hg.mozilla.org/mozilla-central/rev/b87e8e7e7916
https://hg.mozilla.org/mozilla-central/rev/bd5f05cdf119
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Flags: in-testsuite+
Resolution: --- → FIXED

Updated

6 years ago
OS: Mac OS X → All
Hardware: x86 → All

Updated

5 years ago
Depends on: 721750

Updated

5 years ago
Depends on: 738239
Depends on: 755994

Updated

4 years ago
Depends on: 810564

Updated

4 years ago
Depends on: 857924
You need to log in before you can comment on or make changes to this bug.