Skip to content
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

Replace percentage types by combined <*-percentage> types #646

Closed
16 of 20 tasks
SebastianZ opened this issue Oct 25, 2016 · 5 comments
Closed
16 of 20 tasks

Replace percentage types by combined <*-percentage> types #646

SebastianZ opened this issue Oct 25, 2016 · 5 comments

Comments

@SebastianZ
Copy link
Contributor

SebastianZ commented Oct 25, 2016

CSS Values and Units 3 defines several combined percentage data types, which clarify how the percentages will be computed in the end. These types should be used within the syntax definitions of the other specifications.

Affected specifications are:

Sebastian

@SebastianZ SebastianZ changed the title [css-transforms][css-backgrounds][css-images][css-fonts] [css22][css-backgrounds][css-color][css-fonts][css-grid][css-images][css-page-floats][css-position][css-scroll-snap][css-shapes][css-transforms][css-sizing][css-speech][css-tables][css-template][css-text][css-ui] Replace percentage types by combined <*-percentage> types Oct 25, 2016
@SebastianZ SebastianZ changed the title [css22][css-backgrounds][css-color][css-fonts][css-grid][css-images][css-page-floats][css-position][css-scroll-snap][css-shapes][css-transforms][css-sizing][css-speech][css-tables][css-template][css-text][css-ui] Replace percentage types by combined <*-percentage> types Replace percentage types by combined <*-percentage> types Oct 25, 2016
@smfr
Copy link
Contributor

smfr commented Nov 6, 2017

css-transforms-1 fixed in 2644458.

@smfr smfr removed the css-transforms-1 Current Work label Nov 6, 2017
@tabatkins tabatkins removed the css-scroll-snap-1 Current Work label Dec 4, 2017
@frivoal frivoal removed the css-text-3 Current Work label Sep 14, 2018
@svgeesus
Copy link
Contributor

svgeesus commented Jun 26, 2019

I don't think this is appropriate for CSS Color 4. Percentage does not resolve to a number; actually the reverse. Numbers (which for historical reasons are constrained to assume 8 bits per color component) resolve to a percentage. Higher bit depths are increasingly common. Again for historical reasons, we have to use percentage here where really, if this were being designed now, we actually want a float in the range 0.0 to 1.0. But we can't have that because 0 and 1 would mean 0/255 and 1/255, so we have had percentages to stand in for floats since CSS1.

A <number> is equivalent to a <percentage>, but with a different range: 0 again represents the minimum value for the color channel, but 255 represents the maximum. These values come from the fact that many graphics engines store the color channels internally as a single byte, which can hold integers between 0 and 255.

@svgeesus svgeesus removed the css-color-4 Current Work label Jun 26, 2019
@tabatkins
Copy link
Member

That's not why Color doesn't need updating; Color doesn't need updating because there is (now) no <number-percentage> type, as we realized we can't generally handle that combo in calc().

The <*-dimension> types don't imply anything about what range in the non-percentage type maps to 0%-100%. It would be perfectly fine to have the number range [0-255] map to the percent range [0%-100%], if that wasn't disallowed by the type-resolving rules.

@astearns
Copy link
Member

I think there was just one remaining bit in shapes, fixed in 60d3770

@svgeesus
Copy link
Contributor

The remaining affected specs all have open issues now, so this mega-issue can be closed I think. @SebastianZ ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants