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

Unified Diff: sky/specs/apis.md

Issue 699893005: Specs: Give DocumentFragment and Document a common ancestor that is (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/specs/apis.md
diff --git a/sky/specs/apis.md b/sky/specs/apis.md
index 688cd5311761fb51ae3738341c58dd007f8e0d6b..92ea5495cd75c3281e732942b16e22e467f75481 100644
--- a/sky/specs/apis.md
+++ b/sky/specs/apis.md
@@ -115,15 +115,17 @@ module 'sky:core' {
virtual void valueChangeCallback(String? oldValue, String? newValue); // noop
}
- class DocumentFragment : ParentNode {
+ abstract class TreeRoot : ParentNode {
+ Element? findId(String id); // O(1)
+ }
+
+ class DocumentFragment : TreeRoot {
constructor (ChildArguments... nodes); // O(N) in number of arguments plus all their descendants
}
- abstract class TreeScope : ParentNode {
+ abstract class TreeScope : TreeRoot {
readonly attribute Document? ownerDocument; // O(1)
readonly attribute TreeScope? parentScope; // O(1)
-
- Element? findId(String id); // O(1)
}
class ShadowRoot : TreeScope {
@@ -139,8 +141,10 @@ module 'sky:core' {
constructor (String selector); // O(F()) where F() is the complexity of the selector
Boolean matches(Element element); // O(F())
- Element? find(ParentNode root); // O(N*F()) where N is the number of descendants
- Array<Element> findAll(ParentNode root); // O(N*F()) where N is the number of descendants
+ Element? find(Element root); // O(N*F())+O(M) where N is the number of descendants and M the average depth of the tree
+ Element? find(TreeRoot root); // O(N*F()) where N is the number of descendants
+ Array<Element> findAll(Element root); // O(N*F())+O(N*M) where N is the number of descendants and M the average depth of the tree
+ Array<Element> findAll(TreeRoot root); // O(N*F()) where N is the number of descendants
}
« 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