Skip to content

Commit

Permalink
[css-properties-values-api] Add tests for explicit inheritance.
Browse files Browse the repository at this point in the history
R=futhark@chromium.org

Bug: 641877
Change-Id: I5f12db2690ec02248cb0533b2f18da2613afea98
  • Loading branch information
andruud authored and Chrome-bot committed Sep 20, 2018
1 parent 8abd5d0 commit 727a1f5
Showing 1 changed file with 13 additions and 0 deletions.
Expand Up @@ -44,4 +44,17 @@
assert_equals(innerComputedStyle.getPropertyValue('--non-inherited-length-2'), '90px');
assert_equals(innerComputedStyle.getPropertyValue('--non-inherited-length-3'), '6px');
}, "Registered properties are correctly inherited (or not) depending on the inherits flag.");

test(function(){
CSS.registerProperty({name: '--initial-length-1', syntax: '<length>', initialValue: '0px', inherits: false});
outer.style = '--initial-length-1: notalength';
inner.style = '--initial-length-1: inherit';
assert_equals(getComputedStyle(inner).getPropertyValue('--initial-length-1'), '0px');
}, "Explicitly inheriting from a parent with an invalid value results in initial value.");

test(function(){
CSS.registerProperty({name: '--initial-length-2', syntax: '<length>', initialValue: '0px', inherits: false});
inner.style = '--initial-length-2: inherit';
assert_equals(getComputedStyle(inner).getPropertyValue('--initial-length-2'), '0px');
}, "Explicitly inheriting from a parent with no value results in initial value.");
</script>

0 comments on commit 727a1f5

Please sign in to comment.