Skip to content

Navigation Menu

Sign in
Appearance settings
Sign up
Appearance settings

Latest commit

 

History

History
History
33 lines (30 loc) · 975 Bytes

File metadata and controls

33 lines (30 loc) · 975 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<title>CSS Values and Units Test: if() style() condition invalidation</title>
<meta name="assert" content="Test if() style() condition invalidation">
<link rel="help" href="https://drafts.csswg.org/css-values-5/#if-notation">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
html {
--x: 3;
}
#test {
--prop: if(style(--x: 3): true_value; else: false_value;);
}
</style>
<html>
<body>
<div id="test"></div>
</body>
</html>
<script>
setup({ single_test: true });
let elem = document.getElementById('test');
let old_value = window.getComputedStyle(elem).getPropertyValue('--prop');
assert_equals(old_value, "true_value");
document.documentElement.style.setProperty('--x', '0');
let new_value = window.getComputedStyle(elem).getPropertyValue('--prop');
assert_equals( new_value, "false_value");
assert_not_equals(new_value, old_value);
done();
</script>
Morty Proxy This is a proxified and sanitized view of the page, visit original site.