| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 readonly attribute String tagName; // O(1) | 70 readonly attribute String tagName; // O(1) |
| 71 | 71 |
| 72 Boolean hasAttribute(String name); // O(N) in number of attributes | 72 Boolean hasAttribute(String name); // O(N) in number of attributes |
| 73 String getAttribute(String name); // O(N) in number of attributes | 73 String getAttribute(String name); // O(N) in number of attributes |
| 74 void setAttribute(String name, String value = ''); // O(N) in number of attrib
utes | 74 void setAttribute(String name, String value = ''); // O(N) in number of attrib
utes |
| 75 void removeAttribute(String name); // O(N) in number of attributes | 75 void removeAttribute(String name); // O(N) in number of attributes |
| 76 | 76 |
| 77 // Returns a new Array and new Attr instances every time. | 77 // Returns a new Array and new Attr instances every time. |
| 78 Array<Attr> getAttributes(); // O(N) in number of attributes | 78 Array<Attr> getAttributes(); // O(N) in number of attributes |
| 79 | 79 |
| 80 readonly attribute ShadowRoot? shadowRoot; // O(1) // returns the shadow root | 80 readonly attribute ShadowRoot? shadowRoot; // O(1) // returns the shadow root
// TODO(ianh): Should this be mutable? It would help explain how it gets set... |
| 81 Array<ContentElement> getDestinationInsertionPoints(); // O(N) in number of in
sertion points the node is in | 81 Array<ContentElement> getDestinationInsertionPoints(); // O(N) in number of in
sertion points the node is in |
| 82 | 82 |
| 83 virtual void endTagParsedCallback(); // noop | 83 virtual void endTagParsedCallback(); // noop |
| 84 virtual void attributeChangeCallback(String name, String? oldValue, String? ne
wValue); // noop | 84 virtual void attributeChangeCallback(String name, String? oldValue, String? ne
wValue); // noop |
| 85 // TODO(ianh): does a node ever need to know when it's been redistributed? | 85 // TODO(ianh): does a node ever need to know when it's been redistributed? |
| 86 | 86 |
| 87 virtual LayoutManagerConstructor getLayoutManager(); // O(1) | 87 virtual LayoutManagerConstructor getLayoutManager(); // O(1) |
| 88 // default implementation looks up the 'display' property and returns the va
lue: | 88 // default implementation looks up the 'display' property and returns the va
lue: |
| 89 // if (renderNode) | 89 // if (renderNode) |
| 90 // return renderNode.getProperty(phDisplay); | 90 // return renderNode.getProperty(phDisplay); |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 | 282 |
| 283 Boolean matches(Element element); // O(F()) | 283 Boolean matches(Element element); // O(F()) |
| 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 | 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 |
| 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 | 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 |
| 286 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 |
| 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 | 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 |
| 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 | 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 |
| 289 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 |
| 290 } | 290 } |
| 291 ``` | 291 ``` |
| OLD | NEW |