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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Side-by-side diff isn't available for this file because of its large size.
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, 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:
Download patch
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 6ef98dd4e5545e87a8596d87ae754e127d4f48c7..8cfc8b7e98f8879d9673a9e9f02c40dc263b0681 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -28258,6 +28258,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));
}
@@ -28535,6 +28549,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(...);
@@ -28556,6 +28573,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 | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698