| 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 73f50e22c232442e2b8f42fb898e6b27e526d071..bf26a5b84b1c9090a1896c598f93f53bcc97c95c 100644
|
| --- a/sdk/lib/html/dartium/html_dartium.dart
|
| +++ b/sdk/lib/html/dartium/html_dartium.dart
|
| @@ -11476,7 +11476,33 @@ class Event extends NativeFieldWrapperClass1 {
|
| 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()
|
|
|