Chromium Code Reviews| Index: test/codegen/sunflower/dom.dart |
| diff --git a/test/codegen/sunflower/dom.dart b/test/codegen/sunflower/dom.dart |
| index 9a5f2668582d7ca4182213f6fe744274aa6c698d..efea61bd6650a244ecb48264923deafaae3a2064 100644 |
| --- a/test/codegen/sunflower/dom.dart |
| +++ b/test/codegen/sunflower/dom.dart |
| @@ -5,6 +5,8 @@ |
| @JsName(name: 'window') |
| library dom; |
| +@JsName() |
|
vsm
2015/06/24 23:16:15
Do we need both this and the dom.dart under test/b
Jennifer Messerly
2015/06/25 20:11:27
unfortunately, yes. Our server won't follow "../"
|
| +class Window {} |
| class JsName { |
| /// The JavaScript name. |
| @@ -20,22 +22,53 @@ class Overload { |
| const overload = const Overload(); |
| external Document get document; |
| +external Window get window; |
| -@JsName(name: 'Document') |
| -abstract class Document { |
| +@JsName() |
| +abstract class Document extends Node { |
| Element createElement(String name); |
| Element querySelector(String selector); |
| + |
| + HTMLElement head; |
| + HTMLElement body; |
| +} |
| + |
| +@JsName() |
| +class Blob { |
| + external Blob(blobParts, {String type}); |
| } |
| -@JsName(name: 'Element') |
| -abstract class Element { |
| +class CustomEvent { |
| + external CustomEvent(String type, {detail, bubbles, cancelable}); |
| +} |
| + |
| +@JsName() |
| +abstract class Element extends Node { |
| void addEventListener(String type, EventListener callback, [bool capture]); |
| String textContent; |
| - NodeList get childNodes; |
| } |
| @JsName() |
| -class Node {} |
| +abstract class HTMLElement extends Element { |
| + String innerHTML; |
| + HTMLCollection get children; |
| +} |
| + |
| +@JsName() |
| +abstract class Node { |
| + bool hasChildNodes(); |
| + NodeList get childNodes; |
| + |
| + Node insertBefore(Node node, [Node child]); |
| + Node appendChild(Node node); |
| + Node replaceChild(Node node, Node child); |
| + Node removeChild(Node child); |
| +} |
| + |
| +abstract class HTMLCollection { |
| + int get length; |
| + external Element operator [](num index); |
| +} |
| @JsName() |
| class NodeList { |
| @@ -53,16 +86,28 @@ typedef void EventListener(Event e); |
| @JsName() |
| abstract class Event {} |
| +// TODO(jmesserly): rename these |
| @JsName(name: 'HTMLInputElement') |
| -abstract class InputElement extends Element { |
| +abstract class InputElement extends HTMLElement { |
| String value; |
| } |
| @JsName(name: 'HTMLCanvasElement') |
| -abstract class CanvasElement extends Element { |
| +abstract class CanvasElement extends HTMLElement { |
| RenderingContext getContext(String contextId); |
| } |
| +@JsName(name: 'HTMLDivElement') |
| +abstract class DivElement extends HTMLElement { |
| + RenderingContext getContext(String contextId); |
| +} |
| + |
| +@JsName(name: 'HTMLScriptElement') |
| +abstract class ScriptElement extends HTMLElement { |
| + String type; |
| +} |
| + |
| + |
| // TODO(jmesserly): union type of CanvasRenderingContext2D and |
| // WebGLRenderingContext |
| abstract class RenderingContext {} |