Skip to content

[css-color-4][cssom] Overlap between the definition of resolving color values and serializing <color> component values. #982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
frivoal opened this issue Jan 25, 2017 · 5 comments
Labels
Closed Accepted by CSSWG Resolution Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-color-4 Current Work cssom-1 Current Work

Comments

@frivoal
Copy link
Collaborator

frivoal commented Jan 25, 2017

Forked from a comment in another issue

As discussed at the Seattle F2F, there is some overlap between https://drafts.csswg.org/cssom/#serialize-a-css-component-value and https://drafts.csswg.org/css-color-4/#resolving-color-values.

https://drafts.csswg.org/css-color-4/#resolving-color-values is more specific / clear about which color should resolve to what at what time, but cssom is more specific about how to serialize the various functions once you've decided to do that.

Fixing this redundancy by having css-color-4 just keep the high level logic, and defer to cssom for the string level details of how to serialize the value does not seem particularly good to me, as presumably the new functions added to css-color-4 (and later) will have their serialization in css-color-4 (and later), and then you need to look up to multiple specs to have the full picture.

What I think would be nicer is:

  • inline the the details that currently live in cssom into css-color-4
  • have css-color-4 normatively state that it supersedes cssom on this topic
  • either:
    • leave cssom as is, maybe with a note informatively pointing back to color-4)
    • make cssom normatively reference css-color-4 about this.

The comment/issue at the bottom of this section of cssom seems to agree:

One idea is that we can remove this section somewhere in the CSS3/CSS4 timeline by moving the above definitions to the drafts that define the CSS components.

@frivoal frivoal added css-color-4 Current Work cssom-1 Current Work labels Jan 25, 2017
@svgeesus
Copy link
Contributor

related to #1004 #480 #1891 #585

@svgeesus
Copy link
Contributor

svgeesus commented Jan 22, 2020

I agree that having CSS Color 4 supersede CSSOM is cleaner, particularly since CSSOM currently assumes all values can serialize as either rgb() or rgba() in other words 8bit-per-component sRGB. (It also is silent on how to serialize the % form of rgb().

Even the float (%) form of rgb() is currently coerced in some unspecified way to an 8bit int.

@svgeesus
Copy link
Contributor

Having color-4 supersede cssom here was already proposed and accepted

@frivoal frivoal added the Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. label Jan 23, 2020
@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed Overlap between the definition of resolving color values and serializing <color> component values., and agreed to the following:

  • RESOLVED: move serialization into color-4
The full IRC log of that discussion <stantonm> topic: Overlap between the definition of resolving color values and serializing <color> component values.
<astearns> github: https://github.com//issues/982
<stantonm> chris: css object model has not clear text about how to construct these color strings
<stantonm> ... color-4 should obsolete that part of the model
<stantonm> ... do people agree? or do we think it needs serialization
<stantonm> ... even if you have rgb with percentage, some bits get thrown away
<stantonm> ... should it be in color-4 or OM
<stantonm> emilio: as long as its well defined I don't care
<stantonm> TabAtkins: prefer color spec
<stantonm> leaverou: remove it from css OM and just point to color-4
<stantonm> florian: agree, color-4 now has appropriate infomation to represent that spec
<stantonm> RESOLVED: move serialization into color-4
<stantonm> fantasai: before we remove from OM should we publish it
<stantonm> TabAtkins: publish both after the move

@svgeesus
Copy link
Contributor

The overlap has now been separated out:

So the only thing remaining is a PR on CSSOM to remove the color serialization stuff and point to CSS Color 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Accepted by CSSWG Resolution Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-color-4 Current Work cssom-1 Current Work
Projects
None yet
Development

No branches or pull requests

3 participants