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

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

Issue 686243002: Specs: move findId() to TreeScope since it wouldn't be O(1) on Element (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 | no next file » | 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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.
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698