Theming API - validate colors in the schema

NEW
Unassigned

Status

()

Toolkit
WebExtensions: Frontend
P5
normal
11 months ago
10 days ago

People

(Reporter: mattw, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: user-story, triaged)

(Reporter)

Description

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
(Reporter)

Updated

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

Updated

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