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

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

Issue 47543007: Update EventStream docs with new capture method on the string. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tools/dom/src/EventStreamProvider.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index 3af252ea38a68dca7970db175e7316c50827f39b..9f306257dadd6c554eb110cea56222434bc5528d 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -30203,6 +30203,20 @@ abstract class ElementStream<T extends Event> implements Stream<T> {
*/
Stream<T> matches(String selector);
+ /**
+ * Adds a capturing subscription to this stream.
+ *
+ * If the target of the event is a descendant of the element from which this
+ * stream derives then [onData] is called before the event propagates down to
+ * the target. This is the opposite of bubbling behavior, where the event
+ * is first processed for the event target and then bubbles upward.
+ *
+ * ## Other Resources
+ *
+ * * [Event Capture]
+ * (http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow-capture)
+ * from the W3C DOM Events specification.
+ */
StreamSubscription<T> capture(void onData(T event));
}
@@ -30480,6 +30494,9 @@ class EventStreamProvider<T extends Event> {
*
* Element.keyDownEvent.forTarget(element, useCapture: true).listen(...);
*
+ * // Alternate method:
+ * Element.keyDownEvent.forTarget(element).capture(...);
+ *
* Or for listening to an event which will bubble through the DOM tree:
*
* MediaElement.pauseEvent.forTarget(document.body).listen(...);
@@ -30501,6 +30518,13 @@ class EventStreamProvider<T extends Event> {
*
* Element.keyDownEvent.forElement(element, useCapture: true).listen(...);
*
+ * // Alternate method:
+ * Element.keyDownEvent.forElement(element).capture(...);
+ *
+ * Or for listening to an event which will bubble through the DOM tree:
+ *
+ * MediaElement.pauseEvent.forElement(document.body).listen(...);
+ *
* See also:
*
* [addEventListener](http://docs.webplatform.org/wiki/dom/methods/addEventListener)
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tools/dom/src/EventStreamProvider.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698