| OLD | NEW |
| 1 Sky DOM APIs | 1 Sky DOM APIs |
| 2 ============ | 2 ============ |
| 3 | 3 |
| 4 ```javascript | 4 ```dart |
| 5 abstract class ChildNode { } |
| 5 | 6 |
| 6 // Element Tree | 7 abstract class Node extends EventTarget { |
| 8 external TreeScope get ownerScope; // O(1) // never null |
| 7 | 9 |
| 8 typedef ChildNode (Element or Text); | 10 external ParentNode get parentNode; // O(1) |
| 9 typedef ChildArgument (Element or Text or String); | 11 external Element get parentElement; // O(1) // if parentNode isn't an element,
returns null |
| 12 external ChildNode get previousSibling; // O(1) |
| 13 external ChildNode get nextSibling; // O(1) |
| 10 | 14 |
| 11 abstract class Node : EventTarget { // implemented in C++ | 15 @override |
| 12 readonly attribute TreeScope? ownerScope; // O(1) | 16 external List</*@nonnull*/ EventTarget> getEventDispatchChain(); // O(N) in nu
mber of ancestors across shadow trees |
| 13 | 17 // implements EventTarget.getEventDispatchChain() |
| 14 readonly attribute ParentNode? parentNode; // O(1) | 18 // returns the event dispatch chain (including handling shadow trees) |
| 15 readonly attribute Element? parentElement; // O(1) // if parentNode isn't an e
lement, returns null | |
| 16 readonly attribute ChildNode? previousSibling; // O(1) | |
| 17 readonly attribute ChildNode? nextSibling; // O(1) | |
| 18 | |
| 19 virtual Array<EventTarget> getEventDispatchChain(); // O(N) in number of ances
tors across shadow trees // implements EventTarget.getEventDispatchChain() | |
| 20 // returns the event dispatch chain (including handling shadow trees) | |
| 21 | 19 |
| 22 // the following all throw if parentNode is null | 20 // the following all throw if parentNode is null |
| 23 void insertBefore(ChildArgument... nodes); // O(N) in number of arguments plus
all their descendants | 21 external void insertBefore(List</*@nonnull*/ ChildNode> nodes); // O(N) in num
ber of arguments plus all their descendants |
| 24 void insertAfter(ChildArgument... nodes); // O(N) in number of arguments plus
all their descendants | 22 external void insertAfter(List</*@nonnull*/ ChildNode> nodes); // O(N) in numb
er of arguments plus all their descendants |
| 25 void replaceWith(ChildArgument... nodes); // O(N) in number of descendants plu
s arguments plus all their descendants | 23 external void replaceWith(List</*@nonnull*/ ChildNode> nodes); // O(N) in numb
er of descendants plus arguments plus all their descendants |
| 26 void remove(); // O(N) in number of descendants | 24 external void remove(); // O(N) in number of descendants |
| 27 Node cloneNode(Boolean deep = false); // O(1) if deep=false, O(N) in the numbe
r of descendants if deep=true | 25 external Node cloneNode({bool deep: false}); // O(1) if deep=false, O(N) in th
e number of descendants if deep=true |
| 28 | 26 |
| 29 // called when parentNode changes | 27 // called when parentNode changes |
| 30 virtual void parentChangeCallback(ParentNode? oldParent, ParentNode? newParent
, ChildNode? previousSibling, ChildNode? nextSibling); // O(N) in descendants (c
alls attached/detached) | 28 external void parentChangeCallback(ParentNode oldParent, ParentNode newParent,
ChildNode previousSibling, ChildNode nextSibling); // O(N) in descendants |
| 31 virtual void attachedCallback(); // noop | 29 // default implementation calls attached/detached |
| 32 virtual void detachedCallback(); // noop | 30 void attachedCallback() { } |
| 31 void detachedCallback() { } |
| 33 | 32 |
| 34 Array<ContentElement> getDestinationInsertionPoints(); // O(N) in number of in
sertion points the node is in | 33 external List<ContentElement> getDestinationInsertionPoints(); // O(N) in numb
er of insertion points the node is in |
| 35 // returns the <content> elements to which this element was distributed | 34 // returns the <content> elements to which this element was distributed |
| 36 | 35 |
| 37 readonly attribute ElementStyleDeclarationList? style; // O(1) | 36 external ElementStyleDeclarationList get style; // O(1) |
| 38 // for nodes that aren't reachable from the Application Document, returns nu
ll | 37 // for nodes that aren't reachable from the Application Document, returns null |
| 39 // (so in particular orphaned subtrees and nodes in module documents don't h
ave one) | 38 // (so in particular orphaned subtrees and nodes in module documents don't hav
e one) |
| 40 // -- should be updated when the node's parent chain changes (same time as,
e.g., | 39 // -- should be updated when the node's parent chain changes (same time as, e
.g., |
| 41 // the id hashtable is updated) | 40 // the id hashtable is updated) |
| 42 // also always returns null for ContentElement elements and ShadowRoot nodes | 41 // also always returns null for ContentElement elements and ShadowRoot nodes |
| 43 readonly attribute RenderNode? renderNode; // O(1) | 42 |
| 44 // this will be null until the first time it is rendered | 43 external RenderNode get renderNode; // O(1) |
| 45 // it becomes null again when it is taken out of the rendering (see style.md
) | 44 // this will be null until the first time it is rendered |
| 46 abstract virtual LayoutManagerConstructor getLayoutManager(); // O(1) | 45 // it becomes null again when it is taken out of the rendering (see style.md) |
| 47 void resetLayoutManager(); // O(1) | 46 |
| 48 // if renderNode is non-null: | 47 LayoutManagerConstructor getLayoutManager(); // O(1) |
| 49 // sets renderNode.layoutManager to null | 48 |
| 50 // sets renderNode.needsManager to true | 49 void resetLayoutManager() { // O(1) |
| 50 if (renderNode != null) { |
| 51 renderNode._layoutManager = null; |
| 52 renderNode._needsManager = true; |
| 53 } |
| 54 } |
| 51 } | 55 } |
| 52 | 56 |
| 53 abstract class ParentNode : Node { | 57 abstract class ParentNode extends Node { |
| 54 readonly attribute ChildNode? firstChild; // O(1) | 58 external ChildNode get firstChild; // O(1) |
| 55 readonly attribute ChildNode? lastChild; // O(1) | 59 external ChildNode get lastChild; // O(1) |
| 56 | 60 |
| 57 // Returns a new Array every time. | 61 // Returns a new List every time. |
| 58 Array<ChildNode> getChildNodes(); // O(N) in number of child nodes | 62 external List<ChildNode> getChildNodes(); // O(N) in number of child nodes |
| 59 Array<Element> getChildElements(); // O(N) in number of child nodes // TODO(ia
nh): might not be necessary if we have the parser drop unnecessary whitespace te
xt nodes | 63 external List<Element> getChildElements(); // O(N) in number of child nodes |
| 64 // TODO(ianh): might not be necessary if we have the parser drop unnecessary w
hitespace text nodes |
| 60 | 65 |
| 61 void append(ChildArgument... nodes); // O(N) in number of arguments plus all t
heir descendants | 66 external void append(List<ChildNode> nodes); // O(N) in number of arguments pl
us all their descendants |
| 62 void prepend(ChildArgument... nodes); // O(N) in number of arguments plus all
their descendants | 67 external void prepend(List<ChildNode> nodes); // O(N) in number of arguments p
lus all their descendants |
| 63 void replaceChildrenWith(ChildArgument... nodes); // O(N) in number of descend
ants plus arguments plus all their descendants | 68 external void replaceChildrenWith(List<ChildNode> nodes); // O(N) in number of
descendants plus arguments plus all their descendants |
| 64 } | 69 } |
| 65 | 70 |
| 66 class Attr { | 71 class Attr { |
| 67 constructor (String name, String value = ''); // O(1) | 72 const Attr (this.name, [this.value = '']); // O(1) |
| 68 readonly attribute String name; // O(1) | 73 final String name; // O(1) |
| 69 readonly attribute String value; // O(1) | 74 final String value; // O(1) |
| 70 } | 75 } |
| 71 | 76 |
| 72 abstract class Element : ParentNode { | 77 abstract class Element extends ParentNode { |
| 73 readonly attribute String tagName; // O(1) | 78 final String tagName; // O(1) |
| 74 | 79 |
| 75 Boolean hasAttribute(String name); // O(N) in number of attributes | 80 external bool hasAttribute(@nonnull String name); // O(N) in number of attribu
tes |
| 76 String getAttribute(String name); // O(N) in number of attributes | 81 external String getAttribute(@nonnull String name); // O(N) in number of attri
butes |
| 77 void setAttribute(String name, String value = ''); // O(N) in number of attrib
utes | 82 external void setAttribute(@nonnull String name, [@nonnull String value = ''])
; // O(N) in number of attributes |
| 78 void removeAttribute(String name); // O(N) in number of attributes | 83 external void removeAttribute(@nonnull String name); // O(N) in number of attr
ibutes |
| 79 | 84 |
| 80 // Returns a new Array and new Attr instances every time. | 85 // Returns a new Array and new Attr instances every time. |
| 81 Array<Attr> getAttributes(); // O(N) in number of attributes | 86 List<Attr> getAttributes(); // O(N) in number of attributes |
| 82 | 87 |
| 83 readonly attribute ShadowRoot? shadowRoot; // O(1) // returns the shadow root
// TODO(ianh): Should this be mutable? It would help explain how it gets set... | 88 external ShadowRoot get shadowRoot; // O(1) |
| 89 // returns the shadow root |
| 90 // TODO(ianh): Should this be mutable? It would help explain how it gets set..
. |
| 84 | 91 |
| 85 virtual void endTagParsedCallback(); // noop | 92 void endTagParsedCallback() { } |
| 86 virtual void attributeChangeCallback(String name, String? oldValue, String? ne
wValue); // noop | 93 void attributeChangeCallback(String name, String oldValue, String newValue) {
} |
| 94 // name will never be null when this is called by sky |
| 95 |
| 87 // TODO(ianh): does a node ever need to know when it's been redistributed? | 96 // TODO(ianh): does a node ever need to know when it's been redistributed? |
| 88 | 97 |
| 89 virtual LayoutManagerConstructor getLayoutManager(); // O(1) | 98 @override |
| 90 // default implementation looks up the 'display' property and returns the va
lue: | 99 LayoutManagerConstructor getLayoutManager() { // O(1) |
| 91 // if (renderNode) | 100 if (renderNode) |
| 92 // return renderNode.getProperty(phDisplay); | 101 return renderNode.getProperty(phDisplay); |
| 93 // return null; | 102 return super.getLayoutManager(); |
| 103 } |
| 94 } | 104 } |
| 95 | 105 |
| 96 class Text : Node { | 106 class Text extends Node { |
| 97 constructor (String value = ''); // O(1) | 107 external Text([String value = '']); // O(1) |
| 98 attribute String value; // O(1) | 108 // throws if value is null |
| 99 | 109 |
| 100 void replaceWith(String node); // O(1) // special case override of Node.replac
eWith() | 110 external String get value; // O(1) |
| 101 | 111 |
| 102 virtual void valueChangeCallback(String? oldValue, String? newValue); // noop | 112 void valueChangeCallback(String oldValue, String newValue) { } |
| 103 | 113 |
| 104 virtual LayoutManagerConstructor getLayoutManager(); // O(1) | 114 @override |
| 105 // default implementation returns TextLayoutManager's constructor | 115 LayoutManagerConstructor getLayoutManager() { // O(1) |
| 116 return TextLayoutManager; |
| 117 } |
| 106 } | 118 } |
| 107 | 119 |
| 108 class DocumentFragment : ParentNode { | 120 class DocumentFragment extends ParentNode { |
| 121 DocumentFragment([List<ChildNode> nodes = null]); // O(N) in number of argumen
ts plus all their descendants |
| 122 } |
| 123 |
| 124 abstract class TreeScope extends ParentNode { |
| 125 external Document get ownerDocument; // O(1) |
| 126 external TreeScope get parentScope; // O(1) |
| 127 |
| 128 external Element findId(String id); // O(1) |
| 129 // throws if id is null |
| 130 } |
| 131 |
| 132 class ShadowRoot extends TreeScope { |
| 133 ShadowRoot([this._host]); // O(1) |
| 134 // note that there is no way in the API to use a newly created ShadowRoot curr
ently |
| 135 |
| 136 Element _host; |
| 137 Element get host => _host; // O(1) |
| 138 } |
| 139 |
| 140 // DARTIFICATION INCOMPLETE PAST THIS POINT |
| 141 |
| 142 class Document extends TreeScope { |
| 109 constructor (ChildArguments... nodes); // O(N) in number of arguments plus all
their descendants | 143 constructor (ChildArguments... nodes); // O(N) in number of arguments plus all
their descendants |
| 110 } | 144 } |
| 111 | 145 |
| 112 abstract class TreeScope : ParentNode { | 146 class ApplicationDocument extends Document { |
| 113 readonly attribute Document? ownerDocument; // O(1) | |
| 114 readonly attribute TreeScope? parentScope; // O(1) | |
| 115 | |
| 116 Element? findId(String id); // O(1) | |
| 117 } | |
| 118 | |
| 119 class ShadowRoot : TreeScope { | |
| 120 constructor (Element host); // O(1) // note that there is no way in the API to
use a newly created ShadowRoot | |
| 121 readonly attribute Element host; // O(1) | |
| 122 } | |
| 123 | |
| 124 class Document : TreeScope { | |
| 125 constructor (ChildArguments... nodes); // O(N) in number of arguments plus all
their descendants | |
| 126 } | |
| 127 | |
| 128 class ApplicationDocument : Document { | |
| 129 constructor (ChildArguments... nodes); // O(N) in number of /nodes/ arguments
plus all their descendants | 147 constructor (ChildArguments... nodes); // O(N) in number of /nodes/ arguments
plus all their descendants |
| 130 | 148 |
| 131 virtual LayoutManagerConstructor getLayoutManager(); // O(1) | 149 virtual LayoutManagerConstructor getLayoutManager(); // O(1) |
| 132 // returns sky.rootLayoutManager; | 150 // returns sky.rootLayoutManager; |
| 133 } | 151 } |
| 134 | 152 |
| 135 attribute LayoutManagerConstructor rootLayoutManager; // O(1) | 153 attribute LayoutManagerConstructor rootLayoutManager; // O(1) |
| 136 // initially configured to return BlockLayoutManager | 154 // initially configured to return BlockLayoutManager |
| 137 | 155 |
| 138 | 156 |
| 139 // BUILT-IN ELEMENTS | 157 // BUILT-IN ELEMENTS |
| 140 | 158 |
| 141 class ImportElement : Element { | 159 class ImportElement extends Element { |
| 142 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants | 160 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants |
| 143 constructor (ChildArguments... nodes); // shorthand | 161 constructor (ChildArguments... nodes); // shorthand |
| 144 constructor (Dictionary<String> attributes); // shorthand | 162 constructor (Dictionary<String> attributes); // shorthand |
| 145 constructor (); // shorthand | 163 constructor (); // shorthand |
| 146 constructor attribute String tagName; // O(1) // "import" | 164 constructor attribute String tagName; // O(1) // "import" |
| 147 constructor attribute Boolean shadow; // O(1) // false | 165 constructor attribute Boolean shadow; // O(1) // false |
| 148 | 166 |
| 149 virtual LayoutManagerConstructor getLayoutManager(); // O(1) | 167 virtual LayoutManagerConstructor getLayoutManager(); // O(1) |
| 150 // returns null | 168 // returns null |
| 151 } | 169 } |
| 152 class TemplateElement : Element { | 170 class TemplateElement extends Element { |
| 153 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants | 171 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants |
| 154 constructor (ChildArguments... nodes); // shorthand | 172 constructor (ChildArguments... nodes); // shorthand |
| 155 constructor (Dictionary<String> attributes); // shorthand | 173 constructor (Dictionary<String> attributes); // shorthand |
| 156 constructor (); // shorthand | 174 constructor (); // shorthand |
| 157 constructor attribute String tagName; // O(1) // "template" | 175 constructor attribute String tagName; // O(1) // "template" |
| 158 constructor attribute Boolean shadow; // O(1) // false | 176 constructor attribute Boolean shadow; // O(1) // false |
| 159 | 177 |
| 160 readonly attribute DocumentFragment content; // O(1) | 178 readonly attribute DocumentFragment content; // O(1) |
| 161 virtual LayoutManagerConstructor getLayoutManager(); // O(1) | 179 virtual LayoutManagerConstructor getLayoutManager(); // O(1) |
| 162 // returns null | 180 // returns null |
| 163 } | 181 } |
| 164 class ScriptElement : Element { | 182 class ScriptElement extends Element { |
| 165 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants | 183 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants |
| 166 constructor (ChildArguments... nodes); // shorthand | 184 constructor (ChildArguments... nodes); // shorthand |
| 167 constructor (Dictionary<String> attributes); // shorthand | 185 constructor (Dictionary<String> attributes); // shorthand |
| 168 constructor (); // shorthand | 186 constructor (); // shorthand |
| 169 constructor attribute String tagName; // O(1) // "script" | 187 constructor attribute String tagName; // O(1) // "script" |
| 170 constructor attribute Boolean shadow; // O(1) // false | 188 constructor attribute Boolean shadow; // O(1) // false |
| 171 | 189 |
| 172 virtual LayoutManagerConstructor getLayoutManager(); // O(1) | 190 virtual LayoutManagerConstructor getLayoutManager(); // O(1) |
| 173 // returns null | 191 // returns null |
| 174 } | 192 } |
| 175 class StyleElement : Element { | 193 class StyleElement extends Element { |
| 176 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants | 194 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants |
| 177 constructor (ChildArguments... nodes); // shorthand | 195 constructor (ChildArguments... nodes); // shorthand |
| 178 constructor (Dictionary<String> attributes); // shorthand | 196 constructor (Dictionary<String> attributes); // shorthand |
| 179 constructor (); // shorthand | 197 constructor (); // shorthand |
| 180 constructor attribute String tagName; // O(1) // "style" | 198 constructor attribute String tagName; // O(1) // "style" |
| 181 constructor attribute Boolean shadow; // O(1) // false | 199 constructor attribute Boolean shadow; // O(1) // false |
| 182 | 200 |
| 183 Array<Rule> getRules(); // O(N) in rules | 201 Array<Rule> getRules(); // O(N) in rules |
| 184 virtual LayoutManagerConstructor getLayoutManager(); // O(1) | 202 virtual LayoutManagerConstructor getLayoutManager(); // O(1) |
| 185 // returns null | 203 // returns null |
| 186 } | 204 } |
| 187 class ContentElement : Element { | 205 class ContentElement extends Element { |
| 188 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants | 206 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants |
| 189 constructor (ChildArguments... nodes); // shorthand | 207 constructor (ChildArguments... nodes); // shorthand |
| 190 constructor (Dictionary<String> attributes); // shorthand | 208 constructor (Dictionary<String> attributes); // shorthand |
| 191 constructor (); // shorthand | 209 constructor (); // shorthand |
| 192 constructor attribute String tagName; // O(1) // "content" | 210 constructor attribute String tagName; // O(1) // "content" |
| 193 constructor attribute Boolean shadow; // O(1) // false | 211 constructor attribute Boolean shadow; // O(1) // false |
| 194 | 212 |
| 195 Array<Node> getDistributedNodes(); // O(N) in distributed nodes | 213 Array<Node> getDistributedNodes(); // O(N) in distributed nodes |
| 196 virtual LayoutManagerConstructor getLayoutManager(); // O(1) | 214 virtual LayoutManagerConstructor getLayoutManager(); // O(1) |
| 197 // returns null | 215 // returns null |
| 198 } | 216 } |
| 199 class ImgElement : Element { | 217 class ImgElement extends Element { |
| 200 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants | 218 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants |
| 201 constructor (ChildArguments... nodes); // shorthand | 219 constructor (ChildArguments... nodes); // shorthand |
| 202 constructor (Dictionary<String> attributes); // shorthand | 220 constructor (Dictionary<String> attributes); // shorthand |
| 203 constructor (); // shorthand | 221 constructor (); // shorthand |
| 204 constructor attribute String tagName; // O(1) // "img" | 222 constructor attribute String tagName; // O(1) // "img" |
| 205 constructor attribute Boolean shadow; // O(1) // false | 223 constructor attribute Boolean shadow; // O(1) // false |
| 206 | 224 |
| 207 virtual LayoutManagerConstructor getLayoutManager(); // O(1) | 225 virtual LayoutManagerConstructor getLayoutManager(); // O(1) |
| 208 // returns ImgElementLayoutManager | 226 // returns ImgElementLayoutManager |
| 209 } | 227 } |
| 210 class DivElement : Element { | 228 class DivElement extends Element { |
| 211 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants | 229 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants |
| 212 constructor (ChildArguments... nodes); // shorthand | 230 constructor (ChildArguments... nodes); // shorthand |
| 213 constructor (Dictionary<String> attributes); // shorthand | 231 constructor (Dictionary<String> attributes); // shorthand |
| 214 constructor (); // shorthand | 232 constructor (); // shorthand |
| 215 constructor attribute String tagName; // O(1) // "div" | 233 constructor attribute String tagName; // O(1) // "div" |
| 216 constructor attribute Boolean shadow; // O(1) // false | 234 constructor attribute Boolean shadow; // O(1) // false |
| 217 } | 235 } |
| 218 class SpanElement : Element { | 236 class SpanElement extends Element { |
| 219 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants | 237 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants |
| 220 constructor (ChildArguments... nodes); // shorthand | 238 constructor (ChildArguments... nodes); // shorthand |
| 221 constructor (Dictionary<String> attributes); // shorthand | 239 constructor (Dictionary<String> attributes); // shorthand |
| 222 constructor (); // shorthand | 240 constructor (); // shorthand |
| 223 constructor attribute String tagName; // O(1) // "span" | 241 constructor attribute String tagName; // O(1) // "span" |
| 224 constructor attribute Boolean shadow; // O(1) // false | 242 constructor attribute Boolean shadow; // O(1) // false |
| 225 } | 243 } |
| 226 class IframeElement : Element { | 244 class IframeElement extends Element { |
| 227 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants | 245 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants |
| 228 constructor (ChildArguments... nodes); // shorthand | 246 constructor (ChildArguments... nodes); // shorthand |
| 229 constructor (Dictionary<String> attributes); // shorthand | 247 constructor (Dictionary<String> attributes); // shorthand |
| 230 constructor (); // shorthand | 248 constructor (); // shorthand |
| 231 constructor attribute String tagName; // O(1) // "iframe" | 249 constructor attribute String tagName; // O(1) // "iframe" |
| 232 constructor attribute Boolean shadow; // O(1) // false | 250 constructor attribute Boolean shadow; // O(1) // false |
| 233 | 251 |
| 234 virtual LayoutManagerConstructor getLayoutManager(); // O(1) | 252 virtual LayoutManagerConstructor getLayoutManager(); // O(1) |
| 235 // returns IframeElementLayoutManager | 253 // returns IframeElementLayoutManager |
| 236 } | 254 } |
| 237 class TElement : Element { | 255 class TElement extends Element { |
| 238 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants | 256 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants |
| 239 constructor (ChildArguments... nodes); // shorthand | 257 constructor (ChildArguments... nodes); // shorthand |
| 240 constructor (Dictionary<String> attributes); // shorthand | 258 constructor (Dictionary<String> attributes); // shorthand |
| 241 constructor (); // shorthand | 259 constructor (); // shorthand |
| 242 constructor attribute String tagName; // O(1) // "t" | 260 constructor attribute String tagName; // O(1) // "t" |
| 243 constructor attribute Boolean shadow; // O(1) // false | 261 constructor attribute Boolean shadow; // O(1) // false |
| 244 } | 262 } |
| 245 class AElement : Element { | 263 class AElement extends Element { |
| 246 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants | 264 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants |
| 247 constructor (ChildArguments... nodes); // shorthand | 265 constructor (ChildArguments... nodes); // shorthand |
| 248 constructor (Dictionary<String> attributes); // shorthand | 266 constructor (Dictionary<String> attributes); // shorthand |
| 249 constructor (); // shorthand | 267 constructor (); // shorthand |
| 250 constructor attribute String tagName; // O(1) // "a" | 268 constructor attribute String tagName; // O(1) // "a" |
| 251 constructor attribute Boolean shadow; // O(1) // false | 269 constructor attribute Boolean shadow; // O(1) // false |
| 252 } | 270 } |
| 253 class TitleElement : Element { | 271 class TitleElement extends Element { |
| 254 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants | 272 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants |
| 255 constructor (ChildArguments... nodes); // shorthand | 273 constructor (ChildArguments... nodes); // shorthand |
| 256 constructor (Dictionary<String> attributes); // shorthand | 274 constructor (Dictionary<String> attributes); // shorthand |
| 257 constructor (); // shorthand | 275 constructor (); // shorthand |
| 258 constructor attribute String tagName; // O(1) // "title" | 276 constructor attribute String tagName; // O(1) // "title" |
| 259 constructor attribute Boolean shadow; // O(1) // false | 277 constructor attribute Boolean shadow; // O(1) // false |
| 260 | 278 |
| 261 virtual LayoutManagerConstructor getLayoutManager(); // O(1) | 279 virtual LayoutManagerConstructor getLayoutManager(); // O(1) |
| 262 // returns null | 280 // returns null |
| 263 } | 281 } |
| 264 class ErrorElement : Element { | 282 class ErrorElement extends Element { |
| 265 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants | 283 constructor (Dictionary<String> attributes, ChildArguments... nodes); // O(M+N
), M = number of attributes, N = number of nodes plus all their descendants |
| 266 constructor (ChildArguments... nodes); // shorthand | 284 constructor (ChildArguments... nodes); // shorthand |
| 267 constructor (Dictionary<String> attributes); // shorthand | 285 constructor (Dictionary<String> attributes); // shorthand |
| 268 constructor (); // shorthand | 286 constructor (); // shorthand |
| 269 constructor attribute String tagName; // O(1) // "error" | 287 constructor attribute String tagName; // O(1) // "error" |
| 270 constructor attribute Boolean shadow; // O(1) // false | 288 constructor attribute Boolean shadow; // O(1) // false |
| 271 | 289 |
| 272 virtual LayoutManagerConstructor getLayoutManager(); // O(1) | 290 virtual LayoutManagerConstructor getLayoutManager(); // O(1) |
| 273 // returns ErrorElementLayoutManager | 291 // returns ErrorElementLayoutManager |
| 274 } | 292 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 286 class SelectorQuery { | 304 class SelectorQuery { |
| 287 constructor (String selector); // O(F()) where F() is the complexity of the se
lector | 305 constructor (String selector); // O(F()) where F() is the complexity of the se
lector |
| 288 | 306 |
| 289 Boolean matches(Element element); // O(F()) | 307 Boolean matches(Element element); // O(F()) |
| 290 Element? find(Element root); // O(N*F())+O(M) where N is the number of descend
ants and M the average depth of the tree | 308 Element? find(Element root); // O(N*F())+O(M) where N is the number of descend
ants and M the average depth of the tree |
| 291 Element? find(DocumentFragment root); // O(N*F())+O(M) where N is the number o
f descendants and M the average depth of the tree | 309 Element? find(DocumentFragment root); // O(N*F())+O(M) where N is the number o
f descendants and M the average depth of the tree |
| 292 Element? find(TreeScope root); // O(N*F()) where N is the number of descendant
s | 310 Element? find(TreeScope root); // O(N*F()) where N is the number of descendant
s |
| 293 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 | 311 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 |
| 294 Array<Element> findAll(DocumentFragment root); // O(N*F())+O(N*M) where N is t
he number of descendants and M the average depth of the tree | 312 Array<Element> findAll(DocumentFragment root); // O(N*F())+O(N*M) where N is t
he number of descendants and M the average depth of the tree |
| 295 Array<Element> findAll(TreeScope root); // O(N*F()) where N is the number of d
escendants | 313 Array<Element> findAll(TreeScope root); // O(N*F()) where N is the number of d
escendants |
| 314 |
| 296 } | 315 } |
| 297 ``` | 316 ``` |
| OLD | NEW |