- From: David Hyatt <hyatt@apple.com>
- Date: Thu, 26 Jun 2008 22:06:02 -0500
- To: Andrew Fedoniouk <news@terrainformatica.com>
- Cc: Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Håkon Wium Lie <howcome@opera.com>, www-style list <www-style@w3.org>
On Jun 26, 2008, at 9:09 PM, Andrew Fedoniouk wrote: > > Daniel Glazman wrote: >> Håkon Wium Lie wrote: >>> Not according to the proposal, section 3.3: >>> >>> The declaration becomes invalid if the variable does not exist. >> Oops, we'll fix that ;-) >> </Daniel> > > Consider the following: > > @variables > { > ThemeColor: #fe8d12; > } > > body > { > color: var(ThemeColor); > } > > div > { > color: inherit; > } > > Question: what would be the value of div::color? > In other words: what value non-existent variable is being evaluated > to? > Some sort of 'undefined' > No.... inherit values in the CSS back end (in the declaration) are their own type. You get an inherit value... variables don't affect this at all. > One more question: > > @variables > { > ThemeSomething: #fe8d12; > } > > body > { > background: var(ThemeSomething) green; > } > > Question is: where var(ThemeSomething) will go? The CSS declaration contains a property/value pair for "background." The shorthand is not expanded. None of this is in the spec., but in my implementation I have a special value that represents the whole unresolved right side, a CSSVariableDependentValue. If you ask for its cssText you'll get the raw expression, e.g., "var(ThemeSomething) green." I don't think there's any need for this class to be exposed... it can just be a CUSTOM value in the CSS OM. > > What will happen if variable will be changed from "#fe8d12" > to, say, "url(yeek.png)" in runtime? > Any calls to a variable remain unchanged in the back end declarations. The medium-specific front end information will update to try to resolve the new value (and when that fails, the property/ value pair will be ignored.) I encourage you to write tests against the WebKit implementation and try it out. You might answer your own questions and/or find bugs that way that would help us refine the implementation. dave (hyatt@apple.com)
Received on Friday, 27 June 2008 03:06:45 UTC