Skip to content

[Web API type definition issue] HTMLInputElement.alpha, HTMLInputElement.colorspace #2105

@sojs-coder

Description

@sojs-coder

Summary

Missing property definitions per https://html.spec.whatwg.org/multipage/input.html#color-state-(type=color)

Expected vs. Actual Behavior

HTMLInputElement.colospace and HTMLInputElement.alpha all result in TS errors.
lib.dom.generated.d.ts lacks these properties in the interface definitions.

Per WATWG HTML standard, these properties are valid, though accroding to https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/color#browser_compatibility, many browser have yet to implement this feature. This is a known bug on chromium (https://issues.chromium.org/issues/368059226) and should be resolved within the end of the year. Safari already supports these attributes, so they should be added to the spec.

Playground Link

No response

Browser Support

  • This API is supported in at least two major browser engines (not two Chromium-based browsers).

Have Tried The Latest Releases

  • This issue applies to the latest release of TypeScript.
  • This issue applies to the latest release of @types/web.

Additional Context

3 browsers support it: all Apple/Safari (not Chromium). The majority of internet traffic passes through Safari on mobile, which is strong reasoning to add this to the specification, maybe with an experimental flag

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions