Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Gap Decoration: shorthand rule-* computed style values from longhands</title>
<link rel="author" title="Sam Davis Omekara Jr." href="mailto:samomekarajr@microsoft.com">
<script src="/resources/testharness.js" type="text/javascript"></script>
<script src="/resources/testharnessreport.js" type="text/javascript"></script>
</head>
<body>
<div id="target1"></div>
<div id="target2"></div>
<style>
#target1 {
column-rule-color: lime;
row-rule-color: lime;
column-rule-width: 10px;
row-rule-width: 10px;
column-rule-style: solid;
row-rule-style: solid;
}
#target2 {
column-rule-color: blue;
row-rule-color: red;
column-rule-width: 15px;
row-rule-width: 20px;
column-rule-style: double;
row-rule-style: dotted;
}
</style>
<script>
test(function() {
assert_equals(window.getComputedStyle(document.getElementById('target1')).getPropertyValue('rule-color'), 'rgb(0, 255, 0)');
}, "rule-color shorthand computed from longhand values");
test(function() {
assert_equals(window.getComputedStyle(document.getElementById('target1')).getPropertyValue('rule-width'), '10px');
}, "rule-width shorthand computed from longhand values");
test(function() {
assert_equals(window.getComputedStyle(document.getElementById('target1')).getPropertyValue('rule-style'), 'solid');
}, "rule-style shorthand computed from longhand values");
test(function() {
assert_equals(window.getComputedStyle(document.getElementById('target1')).getPropertyValue('rule'), '10px solid rgb(0, 255, 0)');
}, "rule shorthand computed from longhand values");
test(function() {
assert_equals(window.getComputedStyle(document.getElementById('target2')).getPropertyValue('rule-color'), '');
}, "rule-color shorthand cannot be computed from longhand values so expect an empty string");
test(function() {
assert_equals(window.getComputedStyle(document.getElementById('target2')).getPropertyValue('rule-width'), '');
}, "rule-width shorthand cannot be computed from longhand values so expect an empty string");
test(function() {
assert_equals(window.getComputedStyle(document.getElementById('target2')).getPropertyValue('rule-style'), '');
}, "rule-style shorthand cannot be computed from longhand values so expect an empty string");
test(function() {
assert_equals(window.getComputedStyle(document.getElementById('target2')).getPropertyValue('rule'), '');
}, "rule shorthand cannot be computed from longhand values so expect an empty string");
</script>
</body>
</html>