Open Bug 1491743 Opened 6 years ago Updated 2 years ago

invalid CSS property value on ::selection kills the default selection settings

Categories

(Core :: Layout: Text and Fonts, enhancement, P3)

62 Branch
Unspecified
Windows 10
enhancement

Tracking

()

Webcompat Priority P3
Tracking Status
firefox64 --- affected

People

(Reporter: karlcow, Unassigned)

References

()

Details

(Whiteboard: [webcompat])

0. With Firefox Nightly fresh profile.
1. Go to https://codepen.io/webcompat/pen/qMMgaq
2. Select a text in the first paragraph 
   The text is not highlighted.
3. Then select a text in the second paragraph
   The text is highlighted in pink.

Do the same thing with Chrome. The first paragraph, the selection is visible and gives the default selection color.


Firefox seems to loose its ability to show the selection (aka fallback on default) once the property value is invalid.

::selection {background: foobar;}
Summary: It doesn't show highlight over text selected. → invalid CSS property value on ::selection kills the default selection settings
The Blink behavior makes no sense:

.invalid::selection {
  background: foobar;
  z-index: 0;
}

does clear the background. It's just that they optimize away empty declaration blocks which happens to work in this case because the _only_ property is invalid... We could go back at optimizing out empty declaration blocks, but IIRC we didn't want to do it because then devtools wouldn't show those rules. We would need to rewrite the devtools API to make that work, I think. Probably isn't too hard, but also probably not a huge priority?

Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.

Webcompat Priority: --- → ?

See bug 1547409. Migrating whiteboard priority tags to program flags.

Webcompat Priority: revisit → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.