Revision 47c97a405921a671c3ca6ce73818f3a8b5bd8b25 authored by Geoffrey Sneddon on 04 April 2018, 21:24:40 UTC, committed by Geoffrey Sneddon on 04 April 2018, 22:04:57 UTC
1 parent 333fad1
rgb-rounding-001.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Color 4: RGB Channel Rounding</title>
<link rel="author" title="Chris Nardi" href="mailto:cnardi@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-color-4/#rgb-functions">
<meta name="assert" content="Tests if RGB channels indicated as decimals are rounded correctly">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="test" style="color: rgb(45, 23, 27)"></div>
<script>
test(function() {
var element = document.getElementById('test');
color = "rgb(2.5, 3.4, 4.6)";
expected = ["rgb(3, 3, 5)", color];
element.style.cssText = "color: " + color;
assert_in_array(getComputedStyle(element).color, expected);
}, 'Tests that RGB channels are rounded appropriately');
</script>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...