smaug wrote:
Curious, how much have we tested the performance of our implementation and are there some known perf issues?
I have not tested. The only extra work we should be doing at the moment when variables aren't used in the style sheet is nsRuleNode::ResolveVariableReferences. That iterates over all of the properties we are computing for a given frame and checks to see if they are a token stream, and if so, reparses them.
If this is a problem we could easily record on the nsCSS{Compressed,Expanded}DataBlock object during the initial parsing whether a property with a variable reference on the right hand side was encountered, and copy that over when we map the properties into the nsRuleData. Then we could skip the ResolveVariableReferences call if we knew we didn't find any properties with variable references.
When variables are used, we do end up having to parse a variable-reference-using property value twice (once to ensure that variable references are syntactically valid and to record which variables are referenced, and another time after expanding out the variable references), but that is basically what is required by the spec.
_______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform