-
Notifications
You must be signed in to change notification settings - Fork 136
RGB values need clamping #76
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
CSS 2 also says this, but the phrasing in CSS Color Level 4 is a bit clearer: http://dev.w3.org/csswg/css-color/#rgb-functions
My understanding is that since this library doesn’t know the device’s gamut, it shouldn’t be doing the camping. |
Given that, I’m not sure that these two tests are completely valid, but I don’t feel like arguing with CSSWG about that… |
@nical, do you know if moz2d supports at all device gamuts other than 0% to 100% for R, G, and B? |
Moz2d doesn't attempt to do anything with device gamut as far as i know, but maybe some of the underlying backends do stuff under the hood I know that at least cairo clamps color values into the [0 - 1] range for instance. |
Alright, let’s not bother trying to support non-standard gamuts, then. |
Pick up the fix for servo/rust-cssparser#76
Pick up the fix for servo/rust-cssparser#76 `*.ini` files removal based on running `./mach test-css tests/wpt/css-tests/css21_dev/html4/*color*`, I didn’t run the whole test suite.
Upgrade cssparser Pick up the fix for servo/rust-cssparser#76 `*.ini` files removal based on running `./mach test-css tests/wpt/css-tests/css21_dev/html4/*color*`, I didn’t run the whole test suite. r? @larsbergstrom <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6957) <!-- Reviewable:end -->
Upgrade cssparser Pick up the fix for servo/rust-cssparser#76 `*.ini` files removal based on running `./mach test-css tests/wpt/css-tests/css21_dev/html4/*color*`, I didn’t run the whole test suite. r? @larsbergstrom <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6957) <!-- Reviewable:end -->
Upgrade cssparser Pick up the fix for servo/rust-cssparser#76 `*.ini` files removal based on running `./mach test-css tests/wpt/css-tests/css21_dev/html4/*color*`, I didn’t run the whole test suite. r? @larsbergstrom <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6957) <!-- Reviewable:end -->
Upgrade cssparser Pick up the fix for servo/rust-cssparser#76 `*.ini` files removal based on running `./mach test-css tests/wpt/css-tests/css21_dev/html4/*color*`, I didn’t run the whole test suite. r? @larsbergstrom <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6957) <!-- Reviewable:end -->
Pick up the fix for servo/rust-cssparser#76 `*.ini` files removal based on running `./mach test-css tests/wpt/css- tests/css21_dev/html4/*color*`, I didn’t run the whole test suite.
Pick up the fix for servo/rust-cssparser#76 `*.ini` files removal based on running `./mach test-css tests/wpt/css- tests/css21_dev/html4/*color*`, I didn’t run the whole test suite.
Pick up the fix for servo/rust-cssparser#76
Upgrade cssparser Pick up the fix for servo/rust-cssparser#76 `*.ini` files removal based on running `./mach test-css tests/wpt/css-tests/css21_dev/html4/*color*`, I didn’t run the whole test suite. r? @larsbergstrom <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6957) <!-- Reviewable:end -->
Pick up the fix for servo/rust-cssparser#76
Upgrade cssparser Pick up the fix for servo/rust-cssparser#76 `*.ini` files removal based on running `./mach test-css tests/wpt/css-tests/css21_dev/html4/*color*`, I didn’t run the whole test suite. r? @larsbergstrom <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6957) <!-- Reviewable:end -->
CSS Color Level 4 removed the paragraph quoted above about device gamuts outside of 0%...100%. Now it says to clamp: https://drafts.csswg.org/css-color/#rgb-functions
(The "ranges defined here" being 0...255 for unitless numbers and 0%...100% for percentages.) |
…rsbergstrom+dzbarsky Pick up the fix for servo/rust-cssparser#76 `*.ini` files removal based on running `./mach test-css tests/wpt/css-tests/css21_dev/html4/*color*`, I didn’t run the whole test suite. r? @larsbergstrom Source-Repo: https://github.com/servo/servo Source-Revision: 9bd5291aea24f5bc2780c864d207ce1496f8525f
…rsbergstrom+dzbarsky Pick up the fix for servo/rust-cssparser#76 `*.ini` files removal based on running `./mach test-css tests/wpt/css-tests/css21_dev/html4/*color*`, I didn’t run the whole test suite. r? larsbergstrom Source-Repo: https://github.com/servo/servo Source-Revision: 9bd5291aea24f5bc2780c864d207ce1496f8525f UltraBlame original commit: ea4db506c3695509fa14f50d4f6d991808d00291
…rsbergstrom+dzbarsky Pick up the fix for servo/rust-cssparser#76 `*.ini` files removal based on running `./mach test-css tests/wpt/css-tests/css21_dev/html4/*color*`, I didn’t run the whole test suite. r? larsbergstrom Source-Repo: https://github.com/servo/servo Source-Revision: 9bd5291aea24f5bc2780c864d207ce1496f8525f UltraBlame original commit: ea4db506c3695509fa14f50d4f6d991808d00291
…rsbergstrom+dzbarsky Pick up the fix for servo/rust-cssparser#76 `*.ini` files removal based on running `./mach test-css tests/wpt/css-tests/css21_dev/html4/*color*`, I didn’t run the whole test suite. r? larsbergstrom Source-Repo: https://github.com/servo/servo Source-Revision: 9bd5291aea24f5bc2780c864d207ce1496f8525f UltraBlame original commit: ea4db506c3695509fa14f50d4f6d991808d00291
Per http://www.w3.org/TR/CSS2/syndata.html#value-def-color, integers and percentages above the maximum should be clamped.
This breaks tests/wpt/css-tests/css21_dev/html4/background-color-088.htm and tests/wpt/css-tests/css21_dev/html4/background-color-089.htm (integers and percentages, respectively).
The text was updated successfully, but these errors were encountered: