<html>
<head>
<base href="https://bugs.webkit.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - getComputedStyle() can be incorrect when using CSS Custom Properties"
href="https://bugs.webkit.org/show_bug.cgi?id=170708">170708</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>getComputedStyle() can be incorrect when using CSS Custom Properties
</td>
</tr>
<tr>
<th>Product</th>
<td>WebKit
</td>
</tr>
<tr>
<th>Version</th>
<td>Safari 10
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>OS</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>Normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P2
</td>
</tr>
<tr>
<th>Component</th>
<td>CSS
</td>
</tr>
<tr>
<th>Assignee</th>
<td>webkit-unassigned@lists.webkit.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>dfreedm@google.com
</td>
</tr></table>
<p>
<div>
<pre>getComputedStyle of a node can be incorrect when that node uses CSS Custom Properties and an ancestor node which sets CSS Custom Properties is modified.
Example: <a href="http://jsbin.com/ginegud/12/edit?html,console,output">http://jsbin.com/ginegud/12/edit?html,console,output</a>
This example modifies the values of `--border` based on the class selector `.switch`, synchronously calls `getComputedStyle()`, and prints the value of `border-top-width` in the cases of
1) before adding the class `switch`
2) synchronously after adding the class `switch`
3) synchronously removing the class `switch`
Expected:
2px
10px
2px
Actual:
2px
2px
2px</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>