Skip to content

Commit

Permalink
Implement StyleVariables::operator=
Browse files Browse the repository at this point in the history
StyleInheritedVariables uses the assignment operator, but it's not
implemented correctly.

Fixed: 1238686
Change-Id: I2cc41d9ddf5b9959a21671f80702a76cec556ed8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3086699
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/master@{#910876}
  • Loading branch information
andruud authored and chromium-wpt-export-bot committed Aug 11, 2021
1 parent 1bce3fa commit c5776ea
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions css/css-properties-values-api/registered-property-crosstalk.html
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<link rel="help" href="https://drafts.css-houdini.org/css-properties-values-api-1" />
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1238686" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>

@property --x {
syntax: "<number>";
inherits: true;
initial-value: 0;
}

#a {
--y: 0;
}

#b {
--z: 0;
}

#c {
--x: 42;
}

</style>

<div id=a>
<div id=b>
<div id=c>
</div>
</div>
</div>

<script>

test(function(){
assert_equals(getComputedStyle(a).getPropertyValue('--x'), '0');
assert_equals(getComputedStyle(b).getPropertyValue('--x'), '0');
assert_equals(getComputedStyle(c).getPropertyValue('--x'), '42');
}, 'Only #c should be affected by --x:42');

</script>

0 comments on commit c5776ea

Please sign in to comment.