| 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 708bdb016ca2a9c401377247d8acbd598516f465..a6f71bceeb746e7329aa4dc9d7c5ee8cc2e772d9 100644
|
| --- a/sdk/lib/html/dart2js/html_dart2js.dart
|
| +++ b/sdk/lib/html/dart2js/html_dart2js.dart
|
| @@ -11063,7 +11063,33 @@ class Event extends Interceptor native "Event" {
|
| return e;
|
| }
|
|
|
| - Event._private();
|
| + /**
|
| + * Caches the pointer to the element that matches CSS selector involved in
|
| + * the event.
|
| + */
|
| + Element _cachedMatchingTarget;
|
| +
|
| + /**
|
| + * A pointer to the element whose CSS selector matched within which an event
|
| + * was fired. If this Event was not associated with any Event delegation,
|
| + * then this value will be null.
|
| + */
|
| + Element matchingTarget() {
|
| + if (_cachedMatchingTarget == null) {
|
| + var currentTarget = this.currentTarget;
|
| + var target = this.target;
|
| + var matchedTarget;
|
| + while (matchedTarget == null && target != currentTarget &&
|
| + target != null) {
|
| + if (target.matches('.selector')) {
|
| + matchedTarget = target;
|
| + }
|
| + target = target.parent;
|
| + }
|
| + _cachedMatchingTarget = matchedTarget;
|
| + }
|
| + return _cachedMatchingTarget;
|
| + }
|
|
|
| @DomName('Event.AT_TARGET')
|
| @DocsEditable()
|
|
|