Closed Bug 1965029 Opened 4 months ago Closed 21 days ago

Implement color input value attribute as any CSS color

Categories

(Core :: DOM: Forms, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
143 Branch
Tracking Status
relnote-firefox --- 143+
firefox143 --- fixed

People

(Reporter: lwarlow, Assigned: saschanaz)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Keywords: dev-doc-needed)

Attachments

(1 file)

Currently the color input in Gecko only supports hex values in the value attribute of color inputs. The HTML spec has been updated to allow any valid CSS color to be used.

This was added alongside the alpha and colorspace attributes but imo would be a useful addition on its own.

This requires updating HTMLInputElement to use Servo to validate, parse and serialize the value attribute as appropriate. For now the serialization would act as if alpha attribute was missing and colorspace had its default of limited-srgb. This would result in the output still always being a standard hex.

Assignee: nobody → krosylight
Depends on: 1979393
Attachment #9502827 - Attachment description: WIP: Bug 1965029 - Accept CSS color syntax in `input type=color` → Bug 1965029 - Accept CSS color syntax in `input type=color` r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/54057 for changes under testing/web-platform/tests
Pushed by chorotan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/89e73abd8bfa https://hg.mozilla.org/integration/autoland/rev/0f494becca08 Revert "Bug 1965029 - Accept CSS color syntax in `input type=color` r=emilio" for causing mochitest failures on test_input_color_picker_datalist.html

Backed out for causing mochitest failures

Backout link

Push with failures

Failure log

Flags: needinfo?(krosylight)
Upstream PR merged by moz-wptsync-bot
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/54091 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 21 days ago
Resolution: --- → FIXED
Target Milestone: --- → 143 Branch
Upstream PR merged by moz-wptsync-bot
Upstream PR merged by moz-wptsync-bot
Flags: needinfo?(krosylight)

Did you want to nominate this for the Fx143 relnotes?

Flags: needinfo?(krosylight)
Flags: in-testsuite+

I was wondering that... let's do it.

Release Note Request (optional, but appreciated)
[Why is this notable]: The color form control now accepts a broader syntax
[Affects Firefox for Android]: Yes
[Suggested wording]: <input type=color> now recognizes CSS <color> format in addition to the color hex format (#ffffff). This means color names like black and more complex string like rgb(200 200 200) is now a valid input. For now the value will always be converted to the hex format.
[Links (documentation, blog post, etc)]:

relnote-firefox: --- → ?
Flags: needinfo?(krosylight)

Added to the Fx143 relnotes, thanks.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: