Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: sky/specs/apis.md

Issue 705443002: Specs: Explain the parser a bit better. Make the output of registerElement() something you can pass… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | sky/specs/parsing.md » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 Object prototype = Element; 214 Object prototype = Element;
215 } 215 }
216 216
217 interface ElementConstructor { 217 interface ElementConstructor {
218 constructor (Dictionary attributes, ChildArguments... nodes); // O(M+N), M = number of attributes, N = number of nodes plus all their descendants 218 constructor (Dictionary attributes, ChildArguments... nodes); // O(M+N), M = number of attributes, N = number of nodes plus all their descendants
219 constructor (ChildArguments... nodes); // shorthand 219 constructor (ChildArguments... nodes); // shorthand
220 constructor (Dictionary attributes); // shorthand 220 constructor (Dictionary attributes); // shorthand
221 constructor (); // shorthand 221 constructor (); // shorthand
222 222
223 constructor attribute String tagName; 223 constructor attribute String tagName;
224 constructor attribute Boolean shadow;
224 } 225 }
225 226
226 // MODULES 227 // MODULES
227 abstract class AbstractModule : EventTarget { 228 abstract class AbstractModule : EventTarget {
228 readonly attribute Document document; // O(1) // the Documentof the module o r application 229 readonly attribute Document document; // O(1) // the Documentof the module o r application
229 Promise<any> import(String url); // O(Yikes) // returns the module's exports 230 Promise<any> import(String url); // O(Yikes) // returns the module's exports
230 231
231 readonly attribute String url; 232 readonly attribute String url;
232 233
233 // createElement() lets you create elements that will be upgraded later when you register the element 234 // createElement() lets you create elements that will be upgraded later when you register the element
234 Element createElement(String tagName, Dictionary attributes, ChildArguments. .. nodes); // O(M+N), M = number of attributes, N = number of nodes plus all the ir descendants 235 Element createElement(String tagName, Dictionary attributes, ChildArguments. .. nodes); // O(M+N), M = number of attributes, N = number of nodes plus all the ir descendants
235 Element createElement(String tagName, Dictionary attributes); // shorthand 236 Element createElement(String tagName, Dictionary attributes); // shorthand
236 Element createElement(String tagName, ChildArguments... nodes); // shorthand 237 Element createElement(String tagName, ChildArguments... nodes); // shorthand
237 Element createElement(String tagName); // shorthand 238 Element createElement(String tagName); // shorthand
238 239
239 ElementConstructor registerElement(ElementRegistration options); // O(N) in number of outstanding elements with that tag name to be upgraded 240 ElementConstructor registerElement(ElementRegistration options); // O(N) in number of outstanding elements with that tag name to be upgraded
241 // if you call registerElement() with an object that was created by
242 // registerElement(), it just returns the object after registering it,
243 // rather than creating a new constructor
240 244
241 ScriptElement? currentScript; // O(1) // returns the <script> element curren tly being executed if any, and if it's in this module; else null 245 ScriptElement? currentScript; // O(1) // returns the <script> element curren tly being executed if any, and if it's in this module; else null
242 } 246 }
243 247
244 class Module : AbstractModule { 248 class Module : AbstractModule {
245 constructor (Application application, Document document, String url); // O(1 ) 249 constructor (Application application, Document document, String url); // O(1 )
246 readonly attribute Application application; // O(1) 250 readonly attribute Application application; // O(1)
247 251
248 attribute any exports; // O(1) // defaults to the module's document 252 attribute any exports; // O(1) // defaults to the module's document
249 } 253 }
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 the core mojo fabric JS API sky:mojo:fabric:core 432 the core mojo fabric JS API sky:mojo:fabric:core
429 the asyncWait/cancelWait mojo fabric JS API (interface to IPC thread) sky:moj o:fabric:ipc 433 the asyncWait/cancelWait mojo fabric JS API (interface to IPC thread) sky:moj o:fabric:ipc
430 the mojom for the shell, proxying through C++ so that the shell pipe isn't exp osed sky:mojo:shell 434 the mojom for the shell, proxying through C++ so that the shell pipe isn't exp osed sky:mojo:shell
431 the sky API sky:core 435 the sky API sky:core
432 the sky debug symbols for private APIs sky:debug 436 the sky debug symbols for private APIs sky:debug
433 ``` 437 ```
434 438
435 TODO(ianh): determine if we want to separate the "this" from the 439 TODO(ianh): determine if we want to separate the "this" from the
436 Document, especially for Modules, so that exposing a module's element 440 Document, especially for Modules, so that exposing a module's element
437 doesn't expose the module's exports attribute. 441 doesn't expose the module's exports attribute.
OLDNEW
« no previous file with comments | « no previous file | sky/specs/parsing.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698