Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: sky/specs/style.md

Issue 846523003: Specs: try to import elements from module.exports as well as module.exports.* (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/specs/runloop.md ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 741
742 - 'block': sky.BlockLayoutManager 742 - 'block': sky.BlockLayoutManager
743 - 'paragraph': sky.ParagraphLayoutManager 743 - 'paragraph': sky.ParagraphLayoutManager
744 - 'inline': sky.InlineLayoutManager 744 - 'inline': sky.InlineLayoutManager
745 - 'none': null 745 - 'none': null
746 746
747 747
748 Layout managers inherit from the following API: 748 Layout managers inherit from the following API:
749 749
750 ```javascript 750 ```javascript
751 callback LayoutManagerConstructor LayoutManager (RenderNode node);
752
751 class LayoutManager : EventTarget { 753 class LayoutManager : EventTarget {
752 readonly attribute RenderNode node; 754 readonly attribute RenderNode node;
753 constructor LayoutManager(RenderNode node); 755 constructor LayoutManager(RenderNode node);
754 // sets needsManager to false on the node 756 // sets needsManager to false on the node
755 757
756 readonly attribute Boolean autoreap; 758 readonly attribute Boolean autoreap;
757 // defaults to true 759 // defaults to true
758 // when true, any children that are isNew are automatically welcomed by the default layout() 760 // when true, any children that are isNew are automatically welcomed by the default layout()
759 // when true, children that are removd don't get set to isGhost=true, they'r e just removed 761 // when true, children that are removed don't get set to isGhost=true, they' re just removed
760 762
761 virtual Array<EventTarget> getEventDispatchChain(); // O(N) in number of this. node's ancestors // implements EventTarget.getEventDispatchChain() 763 virtual Array<EventTarget> getEventDispatchChain(); // O(N) in number of this. node's ancestors // implements EventTarget.getEventDispatchChain()
762 // let result = []; 764 // let result = [];
763 // let node = this.node; 765 // let node = this.node;
764 // while (node && node.layoutManager) { 766 // while (node && node.layoutManager) {
765 // result.push(node.layoutManager); 767 // result.push(node.layoutManager);
766 // node = node.parentNode; 768 // node = node.parentNode;
767 // } 769 // }
768 // return result; 770 // return result;
769 771
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 ``` 984 ```
983 985
984 * ``t`` 986 * ``t``
985 This adds to itself the declaration as follows: 987 This adds to itself the declaration as follows:
986 ```javascript 988 ```javascript
987 let d = new StyleDeclaration(); 989 let d = new StyleDeclaration();
988 d[pDisplay] = new ObjectStyleValue(ParagraphLayoutManager); 990 d[pDisplay] = new ObjectStyleValue(ParagraphLayoutManager);
989 this.style.addStyles(d); 991 this.style.addStyles(d);
990 ``` 992 ```
991 993
992 The other elements doe't have any default styles. 994 The other elements don't have any default styles.
993 995
994 These declarations are all shared between all the elements (so e.g. if 996 These declarations are all shared between all the elements (so e.g. if
995 you reach in and change the declaration that was added to a ``span`` 997 you reach in and change the declaration that was added to a ``span``
996 element, you're going to change the styles of all the other 998 element, you're going to change the styles of all the other
997 default-hidden elements). (In other words, in the code snippets above, 999 default-hidden elements). (In other words, in the code snippets above,
998 the ``d`` variable is initialised in shared code, and only the 1000 the ``d`` variable is initialised in shared code, and only the
999 addStyles() call is per-element.) 1001 addStyles() call is per-element.)
OLDNEW
« no previous file with comments | « sky/specs/runloop.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698