Theming API - validate colors in the schema




WebExtensions: Frontend
11 months ago
10 days ago


(Reporter: mattw, Unassigned)


(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)


(Whiteboard: user-story, triaged)



11 months ago
The engineering plan mentions supporting a wide range of color values that we'll eventually support. The way we currently handle this is by accepting arbitrary strings and then validating them in the script. However, it would be more efficient and somewhat less prone to bugs if we could catch these errors during schema validation.

Based on the engineering document, at least the following values should be supported:

 - 3-digit and 6-digit hex values
 - rgb and rgba values
 - hsl and hsla values
Blocks: 1341722
Right now we don't have any special validation for the colors, but if they're not of the 3- or 4-length array type that Chrome uses, then they will get validated as a CSS color when they're applied. If they aren't a valid CSS color, then no value will get applied for that property. There isn't any explicit error presented to the theme author.

This doesn't seem like something that we should block enabling on Nightly for. I'll remove this from blocking that bug.
No longer blocks: 1341722


9 months ago
Blocks: 1330328
No longer blocks: 1330335
Blocks: 1330335
No longer blocks: 1330328


3 months ago
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.