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

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

Issue 694413006: Specs: DocumentFragment shouldn't need to track IDs (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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 class Text : Node { 109 class Text : Node {
110 constructor (String value = ''); // O(1) 110 constructor (String value = ''); // O(1)
111 attribute String value; // O(1) 111 attribute String value; // O(1)
112 112
113 void replaceWith(String node); // O(1) // special case override of Node.repl aceWith() 113 void replaceWith(String node); // O(1) // special case override of Node.repl aceWith()
114 114
115 virtual void valueChangeCallback(String? oldValue, String? newValue); // noo p 115 virtual void valueChangeCallback(String? oldValue, String? newValue); // noo p
116 } 116 }
117 117
118 abstract class TreeRoot : ParentNode { 118 class DocumentFragment : ParentNode {
119 constructor (ChildArguments... nodes); // O(N) in number of arguments plus a ll their descendants
120 }
121
122 abstract class TreeScope : ParentNode {
123 readonly attribute Document? ownerDocument; // O(1)
124 readonly attribute TreeScope? parentScope; // O(1)
125
119 Element? findId(String id); // O(1) 126 Element? findId(String id); // O(1)
120 } 127 }
121 128
122 class DocumentFragment : TreeRoot {
123 constructor (ChildArguments... nodes); // O(N) in number of arguments plus a ll their descendants
124 }
125
126 abstract class TreeScope : TreeRoot {
127 readonly attribute Document? ownerDocument; // O(1)
128 readonly attribute TreeScope? parentScope; // O(1)
129 }
130
131 class ShadowRoot : TreeScope { 129 class ShadowRoot : TreeScope {
132 constructor (Element host); // O(1) // note that there is no way in the API to use a newly created ShadowRoot 130 constructor (Element host); // O(1) // note that there is no way in the API to use a newly created ShadowRoot
133 readonly attribute Element host; // O(1) 131 readonly attribute Element host; // O(1)
134 } 132 }
135 133
136 class Document : TreeScope { 134 class Document : TreeScope {
137 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
138 } 136 }
139 137
140 class SelectorQuery { 138 class SelectorQuery {
141 constructor (String selector); // O(F()) where F() is the complexity of the selector 139 constructor (String selector); // O(F()) where F() is the complexity of the selector
142 140
143 Boolean matches(Element element); // O(F()) 141 Boolean matches(Element element); // O(F())
144 Element? find(Element root); // O(N*F())+O(M) where N is the number of desce ndants and M the average depth of the tree 142 Element? find(Element root); // O(N*F())+O(M) where N is the number of desce ndants and M the average depth of the tree
145 Element? find(TreeRoot root); // O(N*F()) where N is the number of descendan ts 143 Element? find(DocumentFragment root); // O(N*F())+O(M) where N is the number of descendants and M the average depth of the tree
144 Element? find(TreeScope root); // O(N*F()) where N is the number of descenda nts
146 Array<Element> findAll(Element root); // O(N*F())+O(N*M) where N is the numb er of descendants and M the average depth of the tree 145 Array<Element> findAll(Element root); // O(N*F())+O(N*M) where N is the numb er of descendants and M the average depth of the tree
147 Array<Element> findAll(TreeRoot root); // O(N*F()) where N is the number of descendants 146 Array<Element> findAll(DocumentFragment root); // O(N*F())+O(N*M) where N is the number of descendants and M the average depth of the tree
147 Array<Element> findAll(TreeScope root); // O(N*F()) where N is the number of descendants
148 } 148 }
149 149
150 150
151 // BUILT-IN ELEMENTS 151 // BUILT-IN ELEMENTS
152 152
153 class ImportElement : Element { 153 class ImportElement : Element {
154 constructor (Dictionary attributes, ChildArguments... nodes); // O(M+N), M = number of attributes, N = number of nodes plus all their descendants 154 constructor (Dictionary attributes, ChildArguments... nodes); // O(M+N), M = number of attributes, N = number of nodes plus all their descendants
155 constructor (ChildArguments... nodes); // shorthand 155 constructor (ChildArguments... nodes); // shorthand
156 constructor (Dictionary attributes); // shorthand 156 constructor (Dictionary attributes); // shorthand
157 constructor (); // shorthand 157 constructor (); // shorthand
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 the core mojo fabric JS API sky:mojo:fabric:core 492 the core mojo fabric JS API sky:mojo:fabric:core
493 the asyncWait/cancelWait mojo fabric JS API (interface to IPC thread) sky:moj o:fabric:ipc 493 the asyncWait/cancelWait mojo fabric JS API (interface to IPC thread) sky:moj o:fabric:ipc
494 the mojom for the shell, proxying through C++ so that the shell pipe isn't exp osed sky:mojo:shell 494 the mojom for the shell, proxying through C++ so that the shell pipe isn't exp osed sky:mojo:shell
495 the sky API sky:core 495 the sky API sky:core
496 the sky debug symbols for private APIs sky:debug 496 the sky debug symbols for private APIs sky:debug
497 ``` 497 ```
498 498
499 TODO(ianh): determine if we want to separate the "this" from the 499 TODO(ianh): determine if we want to separate the "this" from the
500 Document, especially for Modules, so that exposing a module's element 500 Document, especially for Modules, so that exposing a module's element
501 doesn't expose the module's exports attribute. 501 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