d08b6b8c6ecaa462871d1cb2e4522ea85ae10b01: Bug 773296 - Part 8: Resolve and compute CSS variables. r=dbaron
Cameron McCormack <cam@mcc.id.au> - Thu, 12 Dec 2013 13:09:41 +1100 - rev 160058
Push 25821 by cbook@mozilla.com at Thu, 12 Dec 2013 11:53:39 +0000
Bug 773296 - Part 8: Resolve and compute CSS variables. r=dbaron We add a new class CSSVariableResolver whose job is to take the inherited computed variables and the specified variable declarations and to perform cycle removal and resolution of the variables, storing the result in the CSSVariableValues object on an nsStyleVariables. We use CSSVariableResolver in nsRuleNode::ComputeVariablesData. The variable resolver does this: 1. Asks the CSSVariableValues and CSSVariableDeclarations objects to add their variables to it. 2. Calls in to a new nsCSSParser function EnumerateVariableReferences that informs the resolver which other variables a given variable references, and by doing so, builds a graph of variable dependencies. 3. Removes variables involved in cyclic references using Tarjan's strongly connected component algorithm, setting those variables to have an invalid value. 4. Calls in to a new nsCSSParser function ResolveVariableValue to resolve the remaining valid variables by substituting variable references. We extend nsCSSParser::ParseValueWithVariables to take a callback function to be invoked when encountering a variable reference. This lets EnumerateVariableReferences re-use ParseValueWithVariables. CSSParserImpl::ResolveValueWithVariableReferences needs different error handling behaviour from ParseValueWithVariables, so we don't re-use it. CSSParserImpl::AppendImpliedEOFCharacters is used to take the value returned from nsCSSScanner::GetImpliedEOFCharacters while resolving variable references that were declared using custom properties that encountered EOF before being closed properly. The SeparatorRequiredBetweenTokens helper function in nsCSSParser.cpp implements the serialization rules in CSS Syntax Module Level 3: https://dvcs.w3.org/hg/csswg/raw-file/3479cdefc59a/css-syntax/Overview.html#serialization
407ca304dcdad27a18da76261dc82bd07b2bb1a5: Bug 773296 - Part 7: Add a field to nsStyleVariables to store computed variable values. r=dbaron
Cameron McCormack <cam@mcc.id.au> - Thu, 12 Dec 2013 13:09:41 +1100 - rev 160057
Push 25821 by cbook@mozilla.com at Thu, 12 Dec 2013 11:53:39 +0000
Bug 773296 - Part 7: Add a field to nsStyleVariables to store computed variable values. r=dbaron This defines a class CSSVariableValues which is used to store computed variable values. We store them a bit differently from CSSVariableDeclarations -- here we have a hash table of variable names to integer IDs, and then an array of variables where the array index is the ID. This is because later on we'll want a stable order for the variables to return from DOM APIs. In addition to the string value of the variable, we store the type of the first and last token of the variable value. This information will be used when resolving entire variable reference containing values, to determine when to insert "/**/" before and after a resolved var(blah) token. We add a CSSVariableValues member to nsStyleVariables.
65d7e8f8497875b8618f6e1b6c9af03aa1550cba: Bug 773296 - Part 6: Add enum to represent types of CSS tokens involved in serialization. r=dbaron
Cameron McCormack <cam@mcc.id.au> - Thu, 12 Dec 2013 13:09:41 +1100 - rev 160056
Push 25821 by cbook@mozilla.com at Thu, 12 Dec 2013 11:53:39 +0000
Bug 773296 - Part 6: Add enum to represent types of CSS tokens involved in serialization. r=dbaron This adds an enum to nsCSSScanner.h that represents the types of tokens we need to consider when pasting together two adjacent tokens during serialization or variable resolution. For example with: var-a:orange; var-b:red; color:var(a)var(b); we need to generate the string "orange/**/red" to parse for the value of 'color'.
8eae39ddcb7734f710ff2252a213f4d0dbe482aa: Bug 773296 - Part 5: Map variables on a Declaration to nsRuleData. r=dbaron
Cameron McCormack <cam@mcc.id.au> - Thu, 12 Dec 2013 13:09:41 +1100 - rev 160055
Push 25821 by cbook@mozilla.com at Thu, 12 Dec 2013 11:53:39 +0000
Bug 773296 - Part 5: Map variables on a Declaration to nsRuleData. r=dbaron This adds a CSSVariableDeclarations object to nsRuleData and adds a MapRuleInfoInto function to CSSVariableDeclarations so the can copy variable declarations into a nsRuleData's object. We call that from Declaration::Map{Normal,Important}RuleInfoInto. We make HasImportantData return true if we have important variables but no important non-custom properties on a declaration, since that is used to determine whether we have a rule node for important declarations. This means MapImportantRuleInfoInto can no longer assume that mImportantData is non-null.
6d1b73fffa7708f5ba0289c3b878b5ce9ca75323: Bug 773296 - Part 4: Add style struct to store CSS variables. r=dbaron
Cameron McCormack <cam@mcc.id.au> - Thu, 12 Dec 2013 13:09:40 +1100 - rev 160054
Push 25821 by cbook@mozilla.com at Thu, 12 Dec 2013 11:53:39 +0000
Bug 773296 - Part 4: Add style struct to store CSS variables. r=dbaron This adds an nsStyleVariables on which computed variable values will be stored. We don't actually have any properties assigned to nsStyleVariables; eCSSPropertyExtra_Variables which we added earlier isn't a real property. To avoid compiler errors for gVariableFlags being a zero length array, we stick a dummy entry in there. nsRuleNode::ComputeVariablesData does nothing for the moment. nsStyleVariable nsChangeHint calculations always return 0, as later we will compare the actual properties that reference variables to see what changes are required for them.
7069d52b1e601f6bc55b4609e055233b7f5f734d: Bug 773296 - Part 3: Allow more than 27 style structs. r=dbaron
Cameron McCormack <cam@mcc.id.au> - Thu, 12 Dec 2013 13:09:40 +1100 - rev 160053
Push 25821 by cbook@mozilla.com at Thu, 12 Dec 2013 11:53:39 +0000
Bug 773296 - Part 3: Allow more than 27 style structs. r=dbaron This bumps up nsStyleContext::mBits to a uint64_t so that it can fit another style struct. If we're going to need to keep at least 27 style structs, it might be better to split mBits up into two uint32_ts: one for the flags and one for the style struct bits.
e6e4e9b6cf6a1a84b4c56882a10dffb908884150: Bug 773296 - Part 2: Parse CSS variable declarations and store them on Declaration objects. p=ebassi,heycam r=dbaron
Cameron McCormack <cam@mcc.id.au> - Thu, 12 Dec 2013 13:09:40 +1100 - rev 160052
Push 25821 by cbook@mozilla.com at Thu, 12 Dec 2013 11:53:39 +0000
Bug 773296 - Part 2: Parse CSS variable declarations and store them on Declaration objects. p=ebassi,heycam r=dbaron Patch co-authored by Emmanuele Bassi <ebassi@gmail.com> This defines a CSSVariableDeclarations class that holds a set of variable declarations. This is at the specified value stage, so values can either be 'initial', 'inherit' or a token stream (which is what you normally have). The variables are stored in a hash table. Although it's a bit of a hack, we store 'initial' and 'inherit' using special string values that can't be valid token streams (we use "!" and ";"). Declaration objects now can have two CSSVariableDeclarations objects on them, to store normal and !important variable declarations. So that we keep preserving the order of declarations on the object, we inflate mOrder to store uint32_ts, where values from eCSSProperty_COUNT onwards represent custom properties. mVariableOrder stores the names of the variables corresponding to those entries in mOrder. We also add a new nsCSSProperty value, eCSSPropertyExtra_variable, which is used to represent any custom property name. nsCSSProps::LookupProperty can return this value. The changes to nsCSSParser are straightforward. Custom properties are parsed and checked for syntactic validity (e.g. "var(a,)" being invalid) and stored on the Declaration. We use nsCSSScanner's recording ability to grab the unparsed CSS string corresponding to the variable's value.
6ceff347849df2add64f8a0bc680757f1e95c66c: Bug 773296 - Part 1: Add a preference for CSS variables. r=dbaron
Emmanuele Bassi <ebassi@mozilla.com> - Thu, 12 Dec 2013 13:09:40 +1100 - rev 160051
Push 25821 by cbook@mozilla.com at Thu, 12 Dec 2013 11:53:39 +0000
Bug 773296 - Part 1: Add a preference for CSS variables. r=dbaron
8ff43d5afe3e6542d1f835286f0dba8985b62d95: Bug 909170 - Add some tests for @supports conditions with tokens after a declaration's priority. r=dbaron
Cameron McCormack <cam@mcc.id.au> - Thu, 12 Dec 2013 13:09:39 +1100 - rev 160050
Push 25821 by cbook@mozilla.com at Thu, 12 Dec 2013 11:53:39 +0000
Bug 909170 - Add some tests for @supports conditions with tokens after a declaration's priority. r=dbaron
8344fa6ecea634160119b1f21af596b7c39b4126: Bug 948782 - Make test_alerts_noobserve.html wait until its alerts have disappeared before finishing. r=wchen
Cameron McCormack <cam@mcc.id.au> - Thu, 12 Dec 2013 13:08:35 +1100 - rev 160049
Push 25821 by cbook@mozilla.com at Thu, 12 Dec 2013 11:53:39 +0000
Bug 948782 - Make test_alerts_noobserve.html wait until its alerts have disappeared before finishing. r=wchen
517312577287b5c0c54216a31ce65a990e1f4a3c: Bug 948516 - Assert that js::HashTable pointers and enumerators are used correctly; r=luke
Terrence Cole <terrence@mozilla.com> - Tue, 03 Dec 2013 12:51:02 -0800 - rev 160048
Push 25821 by cbook@mozilla.com at Thu, 12 Dec 2013 11:53:39 +0000
Bug 948516 - Assert that js::HashTable pointers and enumerators are used correctly; r=luke
9bc6da580a399618c48a093ecf578f77aaeb6b69: Bug 937317 - touch clobber file. r=me
Bobby Holley <bobbyholley@gmail.com> - Wed, 11 Dec 2013 17:51:59 -0800 - rev 160047
Push 25821 by cbook@mozilla.com at Thu, 12 Dec 2013 11:53:39 +0000
Bug 937317 - touch clobber file. r=me
e4441e59b5f264156a744654b9966c376ff374b2: Bug 937317 - Tests. r=bz
Bobby Holley <bobbyholley@gmail.com> - Wed, 11 Dec 2013 17:51:59 -0800 - rev 160046
Push 25821 by cbook@mozilla.com at Thu, 12 Dec 2013 11:53:39 +0000
Bug 937317 - Tests. r=bz
281184c3f2ee07f5a25f02763e8dda217d8af296: Bug 937317 - Root around GC call GetIncumbentGlobal. r=bz
Steve Fink <sfink@mozilla.com> - Wed, 11 Dec 2013 17:51:58 -0800 - rev 160045
Push 25821 by cbook@mozilla.com at Thu, 12 Dec 2013 11:53:39 +0000
Bug 937317 - Root around GC call GetIncumbentGlobal. r=bz
669b8a7420488aa4220012e983b3c5d475cfd4e0: Bug 937317 - Remove unnecessary AutoSystemCaller usage. r=bz
Bobby Holley <bobbyholley@gmail.com> - Wed, 11 Dec 2013 17:51:58 -0800 - rev 160044
Push 25821 by cbook@mozilla.com at Thu, 12 Dec 2013 11:53:39 +0000
Bug 937317 - Remove unnecessary AutoSystemCaller usage. r=bz See bug 937317 comment 38.
ad7ddc159137ed675bbf347d46aff05dd5259f85: Bug 937317 - Replace all instance of null cx pushing with AutoSystemCaller. r=bz
Bobby Holley <bobbyholley@gmail.com> - Wed, 11 Dec 2013 17:51:58 -0800 - rev 160043
Push 25821 by cbook@mozilla.com at Thu, 12 Dec 2013 11:53:39 +0000
Bug 937317 - Replace all instance of null cx pushing with AutoSystemCaller. r=bz This is an easy bonus chunk of the work to phase out cx pushing in the browser.
ac718a07e3b8383491e8bf03123c2aa6680d80f9: Bug 937317 - Return null from ToWebIDLCallback if one doesn't already exist. r=bz
Bobby Holley <bobbyholley@gmail.com> - Wed, 11 Dec 2013 17:51:58 -0800 - rev 160042
Push 25821 by cbook@mozilla.com at Thu, 12 Dec 2013 11:53:39 +0000
Bug 937317 - Return null from ToWebIDLCallback if one doesn't already exist. r=bz
ab4c7f0f41a44e9c099e5bf15ec70a73df63038f: Bug 937317 - When invoking a callback object, restore the incumbent script settings object from when the callback was created. r=bz
Bobby Holley <bobbyholley@gmail.com> - Wed, 11 Dec 2013 17:51:58 -0800 - rev 160041
Push 25821 by cbook@mozilla.com at Thu, 12 Dec 2013 11:53:39 +0000
Bug 937317 - When invoking a callback object, restore the incumbent script settings object from when the callback was created. r=bz See the 'incumbent script' stuff in the WebIDL spec.
dd2f364eb5d46c4e877f71b649055e52afdbb1bc: Bug 937317 - Pass the entire CallbackObject to CallSetup. r=bz
Bobby Holley <bobbyholley@gmail.com> - Wed, 11 Dec 2013 17:51:57 -0800 - rev 160040
Push 25821 by cbook@mozilla.com at Thu, 12 Dec 2013 11:53:39 +0000
Bug 937317 - Pass the entire CallbackObject to CallSetup. r=bz We need this so that we can grab the incumbent global that we stashed on the CallbackObject.
366a45b41539dca682bb9cb48622d9aea5554e5f: Bug 937317 - Implement and expose GetIncumbentGlobal. r=bz,luke
Bobby Holley <bobbyholley@gmail.com> - Wed, 11 Dec 2013 17:51:57 -0800 - rev 160039
Push 25821 by cbook@mozilla.com at Thu, 12 Dec 2013 11:53:39 +0000
Bug 937317 - Implement and expose GetIncumbentGlobal. r=bz,luke
(0) -100000 -30000 -10000 -3000 -1000 -300 -100 -50 -20 +20 +50 +100 +300 +1000 +3000 +10000 +30000 +100000 +300000 tip