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

Unified Diff: sdk/lib/html/templates/html/impl/impl_EventTarget.darttemplate

Issue 11316258: Document the document class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: more fixes Created 8 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 | « sdk/lib/html/templates/html/impl/impl_Document.darttemplate ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/templates/html/impl/impl_EventTarget.darttemplate
diff --git a/sdk/lib/html/templates/html/impl/impl_EventTarget.darttemplate b/sdk/lib/html/templates/html/impl/impl_EventTarget.darttemplate
index a602e94bc1e8e4fcc42b9e50b4084cbc523d7a59..9094644ba85e67f7ce9a00c8ce2954b2124d82da 100644
--- a/sdk/lib/html/templates/html/impl/impl_EventTarget.darttemplate
+++ b/sdk/lib/html/templates/html/impl/impl_EventTarget.darttemplate
@@ -4,6 +4,19 @@
part of html;
+/**
+ * Base class that supports listening for and dispatching browser events.
+ *
+ * Events can either be accessed by string name (using the indexed getter) or by
+ * getters exposed by subclasses. Use the getters exposed by subclasses when
+ * possible for better compile-time type checks.
+ *
+ * Using an indexed getter:
+ * events['mouseover'].add((e) => print("Mouse over!"));
+ *
+ * Using a getter provided by a subclass:
+ * elementEvents.mouseOver.add((e) => print("Mouse over!"));
+ */
class Events {
/* Raw event target. */
final EventTarget _ptr;
@@ -15,6 +28,9 @@ class Events {
}
}
+/**
+ * Supports adding, removing, and dispatching events for a specific event type.
+ */
class EventListenerList {
final EventTarget _ptr;
@@ -50,6 +66,14 @@ class EventListenerList {
}
/// @domName $DOMNAME
+/**
+ * Base class for all browser objects that support events.
+ *
+ * Use the [on] property to add, remove, and dispatch events (rather than
+ * [$dom_addEventListener], [$dom_dispatchEvent], and
+ * [$dom_removeEventListener]) for compile-time type checks and a more concise
+ * API.
+ */
class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
/** @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent */
« no previous file with comments | « sdk/lib/html/templates/html/impl/impl_Document.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698