| OLD | NEW |
| 1 APIS | 1 APIS |
| 2 ==== | 2 ==== |
| 3 | 3 |
| 4 The Sky core API | 4 The Sky core API |
| 5 ---------------- | 5 ---------------- |
| 6 | 6 |
| 7 ```javascript | 7 ```javascript |
| 8 module 'sky:core' { | 8 module 'sky:core' { |
| 9 | 9 |
| 10 // EVENTS | 10 // EVENTS |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 readonly attribute ChildNode? firstChild; // O(1) | 70 readonly attribute ChildNode? firstChild; // O(1) |
| 71 readonly attribute ChildNode? lastChild; // O(1) | 71 readonly attribute ChildNode? lastChild; // O(1) |
| 72 | 72 |
| 73 // Returns a new Array every time. | 73 // Returns a new Array every time. |
| 74 Array<ChildNode> getChildNodes(); // O(N) in number of child nodes | 74 Array<ChildNode> getChildNodes(); // O(N) in number of child nodes |
| 75 Array<Element> getChildElements(); // O(N) in number of child nodes // TODO(
ianh): might not be necessary if we have the parser drop unnecessary whitespace
text nodes | 75 Array<Element> getChildElements(); // O(N) in number of child nodes // TODO(
ianh): might not be necessary if we have the parser drop unnecessary whitespace
text nodes |
| 76 | 76 |
| 77 void append(ChildArgument... nodes); // O(N) in number of arguments plus all
their descendants | 77 void append(ChildArgument... nodes); // O(N) in number of arguments plus all
their descendants |
| 78 void prepend(ChildArgument... nodes); // O(N) in number of arguments plus al
l their descendants | 78 void prepend(ChildArgument... nodes); // O(N) in number of arguments plus al
l their descendants |
| 79 void replaceChildrenWith(ChildArgument... nodes); // O(N) in number of desce
ndants plus arguments plus all their descendants | 79 void replaceChildrenWith(ChildArgument... nodes); // O(N) in number of desce
ndants plus arguments plus all their descendants |
| 80 | |
| 81 Element? findId(String id); // O(1) | |
| 82 } | 80 } |
| 83 | 81 |
| 84 interface Attr { | 82 interface Attr { |
| 85 constructor (String name, String value); // O(1) | 83 constructor (String name, String value); // O(1) |
| 86 readonly attribute String name; // O(1) | 84 readonly attribute String name; // O(1) |
| 87 readonly attribute String value; // O(1) | 85 readonly attribute String value; // O(1) |
| 88 } | 86 } |
| 89 | 87 |
| 90 interface Element : ParentNode { | 88 interface Element : ParentNode { |
| 91 readonly attribute String tagName; // O(1) | 89 readonly attribute String tagName; // O(1) |
| (...skipping 30 matching lines...) Expand all Loading... |
| 122 virtual void valueChangeCallback(String? oldValue, String? newValue); // noo
p | 120 virtual void valueChangeCallback(String? oldValue, String? newValue); // noo
p |
| 123 } | 121 } |
| 124 | 122 |
| 125 interface DocumentFragment : ParentNode { | 123 interface DocumentFragment : ParentNode { |
| 126 constructor (ChildArguments... nodes); // O(N) in number of arguments plus a
ll their descendants | 124 constructor (ChildArguments... nodes); // O(N) in number of arguments plus a
ll their descendants |
| 127 } | 125 } |
| 128 | 126 |
| 129 abstract interface TreeScope : ParentNode { | 127 abstract interface TreeScope : ParentNode { |
| 130 readonly attribute Document? ownerDocument; // O(1) | 128 readonly attribute Document? ownerDocument; // O(1) |
| 131 readonly attribute TreeScope? parentScope; // O(1) | 129 readonly attribute TreeScope? parentScope; // O(1) |
| 130 |
| 131 Element? findId(String id); // O(1) |
| 132 } | 132 } |
| 133 | 133 |
| 134 interface ShadowRoot : TreeScope { | 134 interface ShadowRoot : TreeScope { |
| 135 constructor (ChildArguments... nodes); // O(N) in number of arguments plus a
ll their descendants | 135 constructor (ChildArguments... nodes); // O(N) in number of arguments plus a
ll their descendants |
| 136 readonly attribute Element? host; // O(1) | 136 readonly attribute Element? host; // O(1) |
| 137 readonly attribute ShadowRoot? olderShadowRoot; // O(1) | 137 readonly attribute ShadowRoot? olderShadowRoot; // O(1) |
| 138 void removeShadowRoot(); // O(N) in descendants | 138 void removeShadowRoot(); // O(N) in descendants |
| 139 } | 139 } |
| 140 | 140 |
| 141 interface Document : TreeScope { | 141 interface Document : TreeScope { |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 magical imports: | 307 magical imports: |
| 308 the core mojo fabric JS API sky:mojo:fabric:core | 308 the core mojo fabric JS API sky:mojo:fabric:core |
| 309 the asyncWait/cancelWait mojo fabric JS API (interface to IPC thread) sky:moj
o:fabric:ipc | 309 the asyncWait/cancelWait mojo fabric JS API (interface to IPC thread) sky:moj
o:fabric:ipc |
| 310 the mojom for the shell, proxying through C++ so that the shell pipe isn't exp
osed sky:mojo:shell | 310 the mojom for the shell, proxying through C++ so that the shell pipe isn't exp
osed sky:mojo:shell |
| 311 the sky API sky:core | 311 the sky API sky:core |
| 312 ``` | 312 ``` |
| 313 | 313 |
| 314 TODO(ianh): determine if we want to separate the "this" from the | 314 TODO(ianh): determine if we want to separate the "this" from the |
| 315 Document, especially for Modules, so that exposing a module's element | 315 Document, especially for Modules, so that exposing a module's element |
| 316 doesn't expose the module's exports attribute. | 316 doesn't expose the module's exports attribute. |
| OLD | NEW |