-
Notifications
You must be signed in to change notification settings - Fork 711
[css-color-4] Resolving and serializing the opacity property #8311
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
Comments
I think clamping should not be defined in 4.2. Representing Transparency: the
It is a sub-section of 4. Representing Colors: the |
I think the way to resolve that is not to not link to a single
The clamping of each one can then be independently specified. WDYT? |
I would keep a single definition (ideally placed below I do not like splitting productions just to apply clamping separately, whereas these productions match the same input. Worse, I also do not like splitting Therefore I think it would be more appropriate to ask Tab Atkins. |
I am concerned by this assertion in <meta name="assert" content="Opacity values less than 0.0 are clamped to 0.0" /> and similarly in <meta name="assert" content="Opacity values greater than 1.0 are clamped to 1.0" /> So specified values are not clamped (see [codepen](https://codepen.io/lilles/pen/YzjQEzj by @lilles) but computed values (which is what @dbaron was testing) are. Right? |
…rify opacity specified values are not clamped. #8311
With 711296f and d995b34, In 3.3. Transparency: the
This seems clearer: Opacity in CSS is typically represented using But other specs should only use However, other specs currently use
So it might be simpler to define In 15.1 Serializing alpha values (CSS Color 4), the emphasized parts below seem redundant:
Besides, one may wonder whether |
Actually I would remove it from 4.2. Representing Transparency in Colors: the
I agree with #7677 (comment), you just need the specified value to be clamped. Implementers may choose to do it at parse time or "just in time" when serializing the specified value. |
The various specs use "parsed value time" frequently. Determining whether this has actually been done at parse time or when serializing the specified value is not, afaict, observable. |
Oh, you mean because that implies a float comparison (if the value is stored as a float)? Maybe we could say "if the serialized value would be '1' or something like that? |
At the current state of #5642, I would just write But "remove |
As I already noted above, But of course you may have reasons not to follow these suggestions. |
The issue I see with that, is that it is linking to a property definition (the opacity property), not to a value type. I also see some other specs allow only I agree that a production rule needs to be added. |
I understand your concern about using I cannot find any property that only allows |
|
Yes, I think |
Based on the property names ( |
As @lilles originally noted in passing
The part is now clear that this only applies to the alpha component of
<color>
values, but now we need a separate section defining that there is noopacity
clamping, and how this is resolved and serialized.The text was updated successfully, but these errors were encountered: