OLD | NEW |
1 Sky Style Language | 1 Sky Style Language |
2 ================== | 2 ================== |
3 | 3 |
4 Planed changes | 4 Planed changes |
5 -------------- | 5 -------------- |
6 | 6 |
7 Add //-to-end-of-line comments to be consistent with the script | 7 Add //-to-end-of-line comments to be consistent with the script |
8 language. | 8 language. |
9 | 9 |
10 | 10 |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 any resolve(PropertyHandle property, RenderNode node, StyleValueResolverSettin
gs? settings = null); | 353 any resolve(PropertyHandle property, RenderNode node, StyleValueResolverSettin
gs? settings = null); |
354 } | 354 } |
355 */ | 355 */ |
356 | 356 |
357 class ObjectStyleValue : AbstractOpaqueStyleValue { | 357 class ObjectStyleValue : AbstractOpaqueStyleValue { |
358 constructor(StyleNode parentNode, any value); | 358 constructor(StyleNode parentNode, any value); |
359 // calls superclass constructor | 359 // calls superclass constructor |
360 } | 360 } |
361 | 361 |
362 dictionary PropertySettings { | 362 dictionary PropertySettings { |
363 String name; | 363 String? name = null; // null if the property can't be set from a <style> block |
364 StyleGrammar grammar; | 364 StyleGrammar? grammar = null; // msut be non-null if name is non-null; must be
null otherwise |
365 Boolean inherited = false; | 365 Boolean inherited = false; |
366 any initialValue = null; | 366 any initialValue = null; |
367 Boolean needsManager = false; | 367 Boolean needsManager = false; |
368 Boolean needsLayout = false; | 368 Boolean needsLayout = false; |
369 Boolean needsPaint = false; | 369 Boolean needsPaint = false; |
370 // PropertyHandle propertyHandle; // assigned by registerProperty | 370 // PropertyHandle propertyHandle; // assigned by registerProperty |
371 // Integer dependencyBit; // assigned by StyleValueResolverSettings.dependsOn(
) | 371 // Integer dependencyBit; // assigned by StyleValueResolverSettings.dependsOn(
) |
372 } | 372 } |
373 typedef PropertyHandle Integer; | 373 typedef PropertyHandle Integer; |
374 PropertyHandle registerProperty(PropertySettings propertySettings); | 374 PropertyHandle registerProperty(PropertySettings propertySettings); |
| 375 // registers a property with the given settings, and returns an integer >= 0 |
| 376 // that can be used to refer to this property |
375 | 377 |
376 // sky:core exports a bunch of style grammars so that people can extend them | 378 // sky:core exports a bunch of style grammars so that people can extend them |
377 attribute StyleGrammar PositiveLengthOrInfinityStyleGrammar; // resolves to Leng
thStyleValue | 379 attribute StyleGrammar PositiveLengthOrInfinityStyleGrammar; // resolves to Leng
thStyleValue |
378 attribute StyleGrammar PositiveLengthOrAutoStyleGrammar; // resolves to LengthSt
yleValue or IdentifierStyleValue (with value 'auto') | 380 attribute StyleGrammar PositiveLengthOrAutoStyleGrammar; // resolves to LengthSt
yleValue or IdentifierStyleValue (with value 'auto') |
379 attribute StyleGrammar PositiveLengthStyleGrammar; // resolves to LengthStyleVal
ue | 381 attribute StyleGrammar PositiveLengthStyleGrammar; // resolves to LengthStyleVal
ue |
380 attribute StyleGrammar NumberGrammar; // resolves to NumericStyleValue | 382 attribute StyleGrammar NumberGrammar; // resolves to NumericStyleValue |
381 attribute StyleGrammar ColorGrammar; // resolves to ColorStyleValue | 383 attribute StyleGrammar ColorGrammar; // resolves to ColorStyleValue |
382 attribute StyleGrammar DisplayStyleGrammar; // resolves to ObjectStyleValue | 384 attribute StyleGrammar DisplayStyleGrammar; // resolves to ObjectStyleValue |
383 ``` | 385 ``` |
384 | 386 |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 ``` | 924 ``` |
923 | 925 |
924 The ``div`` element doesn't have any default styles. | 926 The ``div`` element doesn't have any default styles. |
925 | 927 |
926 These declarations are all shared between all the elements (so e.g. if | 928 These declarations are all shared between all the elements (so e.g. if |
927 you reach in and change the declaration that was added to a ``title`` | 929 you reach in and change the declaration that was added to a ``title`` |
928 element, you're going to change the styles of all the other | 930 element, you're going to change the styles of all the other |
929 default-hidden elements). (In other words, in the code snippets above, | 931 default-hidden elements). (In other words, in the code snippets above, |
930 the ``d`` variable is initialised in shared code, and only the | 932 the ``d`` variable is initialised in shared code, and only the |
931 addStyles() call is per-element.) | 933 addStyles() call is per-element.) |
OLD | NEW |