| OLD | NEW |
| 1 Sky DOM APIs | 1 Sky DOM APIs |
| 2 ============ | 2 ============ |
| 3 | 3 |
| 4 ```javascript | 4 ```javascript |
| 5 | 5 |
| 6 // Element Tree | 6 // Element Tree |
| 7 | 7 |
| 8 typedef ChildNode (Element or Text); | 8 typedef ChildNode (Element or Text); |
| 9 typedef ChildArgument (Element or Text or String); | 9 typedef ChildArgument (Element or Text or String); |
| 10 | 10 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 class ShadowRoot : TreeScope { | 119 class ShadowRoot : TreeScope { |
| 120 constructor (Element host); // O(1) // note that there is no way in the API to
use a newly created ShadowRoot | 120 constructor (Element host); // O(1) // note that there is no way in the API to
use a newly created ShadowRoot |
| 121 readonly attribute Element host; // O(1) | 121 readonly attribute Element host; // O(1) |
| 122 } | 122 } |
| 123 | 123 |
| 124 class Document : TreeScope { | 124 class Document : TreeScope { |
| 125 constructor (ChildArguments... nodes); // O(N) in number of arguments plus all
their descendants | 125 constructor (ChildArguments... nodes); // O(N) in number of arguments plus all
their descendants |
| 126 } | 126 } |
| 127 | 127 |
| 128 class ApplicationDocument : Document { | 128 class ApplicationDocument : Document { |
| 129 constructor (GestureManager gestureManager, ChildArguments... nodes); // O(N)
in number of /nodes/ arguments plus all their descendants | 129 constructor (ChildArguments... nodes); // O(N) in number of /nodes/ arguments
plus all their descendants |
| 130 | 130 |
| 131 virtual LayoutManagerConstructor getLayoutManager(); // O(1) | 131 virtual LayoutManagerConstructor getLayoutManager(); // O(1) |
| 132 // returns sky.rootLayoutManager; | 132 // returns sky.rootLayoutManager; |
| 133 | |
| 134 readonly attribute GestureManager gestureManager; | |
| 135 } | 133 } |
| 136 | 134 |
| 137 attribute LayoutManagerConstructor rootLayoutManager; // O(1) | 135 attribute LayoutManagerConstructor rootLayoutManager; // O(1) |
| 138 // initially configured to return BlockLayoutManager | 136 // initially configured to return BlockLayoutManager |
| 139 | 137 |
| 140 | 138 |
| 141 // BUILT-IN ELEMENTS | 139 // BUILT-IN ELEMENTS |
| 142 | 140 |
| 143 class ImportElement : Element { | 141 class ImportElement : Element { |
| 144 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants | 142 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 288 |
| 291 Boolean matches(Element element); // O(F()) | 289 Boolean matches(Element element); // O(F()) |
| 292 Element? find(Element root); // O(N*F())+O(M) where N is the number of descend
ants and M the average depth of the tree | 290 Element? find(Element root); // O(N*F())+O(M) where N is the number of descend
ants and M the average depth of the tree |
| 293 Element? find(DocumentFragment root); // O(N*F())+O(M) where N is the number o
f descendants and M the average depth of the tree | 291 Element? find(DocumentFragment root); // O(N*F())+O(M) where N is the number o
f descendants and M the average depth of the tree |
| 294 Element? find(TreeScope root); // O(N*F()) where N is the number of descendant
s | 292 Element? find(TreeScope root); // O(N*F()) where N is the number of descendant
s |
| 295 Array<Element> findAll(Element root); // O(N*F())+O(N*M) where N is the number
of descendants and M the average depth of the tree | 293 Array<Element> findAll(Element root); // O(N*F())+O(N*M) where N is the number
of descendants and M the average depth of the tree |
| 296 Array<Element> findAll(DocumentFragment root); // O(N*F())+O(N*M) where N is t
he number of descendants and M the average depth of the tree | 294 Array<Element> findAll(DocumentFragment root); // O(N*F())+O(N*M) where N is t
he number of descendants and M the average depth of the tree |
| 297 Array<Element> findAll(TreeScope root); // O(N*F()) where N is the number of d
escendants | 295 Array<Element> findAll(TreeScope root); // O(N*F()) where N is the number of d
escendants |
| 298 } | 296 } |
| 299 ``` | 297 ``` |
| OLD | NEW |