Bug 155782

Summary: Some CSS Custom Properties do not recalculate when new stylesheet is added to DOM
Product: WebKit Reporter: Daniel Freedman <dfreedm>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: eoconnor, hyatt, koivisto, rniwa, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 9   
Hardware: Unspecified   
OS: OS X 10.11   
Attachments:
Description Flags
Minimal reproduction none

Description Daniel Freedman 2016-03-22 21:21:53 PDT
If a stylesheet is added to the DOM dynamically, and it defines a CSS Custom Property used in another rule for the border property, it does not apply the border effect.

Steps to reproduce
1. Load attached css-vars-late-style.html in Safari 9.1
2. Note that the element with text content "Should be bordered" does not have a border

Expected Results
Div with content "Should be bordered" should have a 10px solid green border.

Actual Results
Div is not bordered

Works in Chrome 49 and Firefox 45
Comment 1 Daniel Freedman 2016-03-22 21:22:19 PDT
Created attachment 274726 [details]
Minimal reproduction
Comment 2 Daniel Freedman 2016-03-22 21:24:58 PDT
After playing with it in the Dev Tools, setting display to none and back to block will trigger the correct effect.
Comment 3 Radar WebKit Bug Importer 2016-03-24 18:23:08 PDT
<rdar://problem/25351781>
Comment 4 Simon Fraser (smfr) 2016-03-24 18:42:30 PDT

*** This bug has been marked as a duplicate of bug 154785 ***