Closed Bug 238587 Opened 18 years ago Closed 17 years ago

CSS3 opacity breaks text selection


(Core :: DOM: Selection, defect)

Windows XP
Not set





(Reporter: christopher.vance, Unassigned)




(Keywords: testcase)


(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7b) Gecko/20040324
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7b) Gecko/20040324

If the opacity of an element is too low, text selections that begin inside the
element cannot extend outside the element.

Text selection breaks when beginning the selection with text in an element with
CSS opacity between 0.0 and 0.9999999701.  When the opacity is higher (i.e.
opacity: 0.9999999702; to opacity: 1.0;), text selection works in all cases.

I think the long 0.9 number could be clarified... I noticed text selections
working at opacity: 0.999999971 but not working at opacity: 0.99999997 and
experimented a bit more til I got a more precise number.

Text selections are fine when beginning above or below the somewhat-transparent
region and include that region in the selection.  Selections beginning in the
region breaks text selection.

Reproducible: Always
Steps to Reproduce:
1. Visit a page containing text in an HTML element which has CSS opacity set to
a value between 0.0 and 0.9999999701, inclusive.
2. Start a text selection in the element with opacity, and drag the mouse to
select more text.  Try to drag and select text above or below the element with
Actual Results:  
The text selection stops at the edge of the element which has opacity set.

Expected Results:  
Text selections which begin in elements which have opacity set should be allowed
to contain text selected in non-transparent sections of the page.

Seen in 1.7b and Mozilla 1.7 build 2004032408 on WinXP, and the testcase was
verified by a Linux user running a compiled 3/23 build.
Forgot to mention: shows an
opaque element opaque enough that selection works... CSS opacity set to
This will be fixed by the fix for 53966.
Depends on: 53966
I see the problem you refer to. I CONFIRM this bug mostly because if text
selection can work from starting before such element (with an opacity != 1.0) or
from starting after such element, then I don't see why it should not work from
starting within such element.

The 0.9999999702 borderline number is most likely just an rounding up issue of a
float number. Any opacity value different from 1.0 (internally resolved as such)
will have the selection issue you see.
Ever confirmed: true
Keywords: testcase
In comment #4, I forgot to mention that I was using Mozilla 1.8 alpha build
2004050907 under XP Pro.
(In reply to comment #3)
> This will be fixed by the fix for 53966.

Indeed. With bug 53966 fixed now, the attached testcases in this bug work as
expected. :-) Tested with a Linux trunk build from today.

Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.