| 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 13 matching lines...) Expand all Loading... |
| 24 } | 24 } |
| 25 | 25 |
| 26 callback EventListener any (Event event); // return value is assigned to Event
.result | 26 callback EventListener any (Event event); // return value is assigned to Event
.result |
| 27 | 27 |
| 28 interface EventTarget { | 28 interface EventTarget { |
| 29 any dispatchEvent(Event event); // O(N) in total number of listeners for thi
s type in the chain // returns Event.result | 29 any dispatchEvent(Event event); // O(N) in total number of listeners for thi
s type in the chain // returns Event.result |
| 30 void addEventListener(String type, EventListener listener); // O(1) | 30 void addEventListener(String type, EventListener listener); // O(1) |
| 31 void removeEventListener(String type, EventListener listener); // O(N) in ev
ent listeners with that type | 31 void removeEventListener(String type, EventListener listener); // O(N) in ev
ent listeners with that type |
| 32 } | 32 } |
| 33 | 33 |
| 34 interface CustomEventTarget { | 34 interface CustomEventTarget : EventTarget { |
| 35 constructor (); // O(1) | 35 constructor (); // O(1) |
| 36 attribute EventTarget parentNode; // getter O(1), setter O(N) in height of t
ree, throws if this would make a loop | 36 attribute EventTarget parentNode; // getter O(1), setter O(N) in height of t
ree, throws if this would make a loop |
| 37 | 37 |
| 38 // you can inherit from this to make your object into an event target | 38 // you can inherit from this to make your object into an event target |
| 39 } | 39 } |
| 40 | 40 |
| 41 | 41 |
| 42 | 42 |
| 43 // DOM | 43 // DOM |
| 44 | 44 |
| (...skipping 262 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 |