Skip to content

Commit

Permalink
Rewrite property-cascade.html with getComputedStyle() (#42623)
Browse files Browse the repository at this point in the history
  • Loading branch information
fred-wang authored Oct 20, 2023
1 parent 3375400 commit 0d569c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions css/css-properties-values-api/property-cascade.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
test(function(){
// Because var(--my-color) is invalid, our color declaration should behave
// like color:unset, i.e. it should compute to the inherited color.
assert_equals(inner.computedStyleMap().get('color').toString(), 'rgb(1, 1, 1)');
assert_equals(getComputedStyle(inner).color, 'rgb(1, 1, 1)');

CSS.registerProperty({
name: '--my-color',
Expand All @@ -36,7 +36,7 @@
// After registering, var(--my-color) is still invalid. The important thing
// here is that the computed value of color is the initialValue of
// --my-color, and not rgb(2, 2, 2).
assert_equals(inner.computedStyleMap().get('color').toString(), 'rgb(3, 3, 3)');
assert_equals(getComputedStyle(inner).color, 'rgb(3, 3, 3)');
}, 'Registering a property does not affect cascade');

test(function(){
Expand All @@ -56,7 +56,7 @@

outer.appendChild(element);

assert_equals(element.computedStyleMap().get('color').toString(), 'rgb(4, 4, 4)');
assert_equals(getComputedStyle(element).color, 'rgb(4, 4, 4)');
}, 'Registering a property does not affect parsing');


Expand Down

0 comments on commit 0d569c2

Please sign in to comment.