NEW 170708
getComputedStyle() can be incorrect when using CSS Custom Properties
https://bugs.webkit.org/show_bug.cgi?id=170708
Summary getComputedStyle() can be incorrect when using CSS Custom Properties
Daniel Freedman
Reported 2017-04-10 16:41:11 PDT
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: http://jsbin.com/ginegud/12/edit?html,console,output 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
Attachments
Radar WebKit Bug Importer
Comment 1 2017-04-10 21:16:51 PDT
Ahmad Saleem
Comment 2 2022-08-06 18:44:44 PDT
I am able to reproduce this issue in Safari 15.6 on macOS 12.5 using below mentioned "JSBin": *** Safari 15.6 on macOS 12.5 *** "2px" "2px" "2px" *** Chrome Canary 106 *** "2px" "10px" "2px" *** Firefox Nightly 105 *** "2px" "10px" "2px"
Note You need to log in before you can comment on or make changes to this bug.