| OLD | NEW |
| 1 Sky DOM APIs | 1 Sky DOM APIs |
| 2 ============ | 2 ============ |
| 3 | 3 |
| 4 ```javascript | 4 ```javascript |
| 5 | 5 |
| 6 // DOM | 6 // DOM |
| 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 constructor (ChildArguments... nodes); // shorthand | 260 constructor (ChildArguments... nodes); // shorthand |
| 261 constructor (Dictionary<String> attributes); // shorthand | 261 constructor (Dictionary<String> attributes); // shorthand |
| 262 constructor (); // shorthand | 262 constructor (); // shorthand |
| 263 constructor attribute String tagName; // O(1) // "error" | 263 constructor attribute String tagName; // O(1) // "error" |
| 264 constructor attribute Boolean shadow; // O(1) // false | 264 constructor attribute Boolean shadow; // O(1) // false |
| 265 | 265 |
| 266 virtual LayoutManagerConstructor getLayoutManager(); // O(1) | 266 virtual LayoutManagerConstructor getLayoutManager(); // O(1) |
| 267 // returns ErrorElementLayoutManager | 267 // returns ErrorElementLayoutManager |
| 268 } | 268 } |
| 269 | 269 |
| 270 callback InternalElementConstructor void (Module module); | |
| 271 dictionary ElementRegistration { | |
| 272 String tagName; | |
| 273 Boolean shadow = false; | |
| 274 InternalElementConstructor? constructor = null; | |
| 275 } | |
| 276 | |
| 277 interface ElementConstructor { | 270 interface ElementConstructor { |
| 278 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants | 271 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants |
| 279 constructor (ChildArguments... nodes); // shorthand | 272 constructor (ChildArguments... nodes); // shorthand |
| 280 constructor (Dictionary<String> attributes); // shorthand | 273 constructor (Dictionary<String> attributes); // shorthand |
| 281 constructor (); // shorthand | 274 constructor (); // shorthand |
| 282 | 275 |
| 283 constructor attribute String tagName; | 276 constructor attribute String tagName; |
| 284 constructor attribute Boolean shadow; | 277 constructor attribute Boolean shadow; |
| 285 } | 278 } |
| 286 | 279 |
| 287 class SelectorQuery { | 280 class SelectorQuery { |
| 288 constructor (String selector); // O(F()) where F() is the complexity of the se
lector | 281 constructor (String selector); // O(F()) where F() is the complexity of the se
lector |
| 289 | 282 |
| 290 Boolean matches(Element element); // O(F()) | 283 Boolean matches(Element element); // O(F()) |
| 291 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 | 284 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 |
| 292 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 | 285 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 |
| 293 Element? find(TreeScope root); // O(N*F()) where N is the number of descendant
s | 286 Element? find(TreeScope root); // O(N*F()) where N is the number of descendant
s |
| 294 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 | 287 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 |
| 295 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 | 288 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 |
| 296 Array<Element> findAll(TreeScope root); // O(N*F()) where N is the number of d
escendants | 289 Array<Element> findAll(TreeScope root); // O(N*F()) where N is the number of d
escendants |
| 297 } | 290 } |
| 298 ``` | 291 ``` |
| OLD | NEW |