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

Side by Side Diff: tools/dom/templates/html/impl/impl_Event.darttemplate

Issue 52443007: Allow matchingTarget to also include the currentTarget. (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:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/html/element_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // WARNING: Do not edit - generated code. 5 // WARNING: Do not edit - generated code.
6 6
7 part of $LIBRARYNAME; 7 part of $LIBRARYNAME;
8 8
9 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { 9 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
10 // In JS, canBubble and cancelable are technically required parameters to 10 // In JS, canBubble and cancelable are technically required parameters to
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 * accessing this value will throw an [UnsupportedError]. 43 * accessing this value will throw an [UnsupportedError].
44 */ 44 */
45 Element get matchingTarget { 45 Element get matchingTarget {
46 if (_selector == null) { 46 if (_selector == null) {
47 throw new UnsupportedError('Cannot call matchingTarget if this Event did' 47 throw new UnsupportedError('Cannot call matchingTarget if this Event did'
48 ' not arise as a result of event delegation.'); 48 ' not arise as a result of event delegation.');
49 } 49 }
50 var currentTarget = this.currentTarget; 50 var currentTarget = this.currentTarget;
51 var target = this.target; 51 var target = this.target;
52 var matchedTarget; 52 var matchedTarget;
53 while (matchedTarget == null && target != currentTarget && target != null) { 53 while (matchedTarget == null && target != currentTarget.parent && target != null) {
blois 2013/10/30 23:12:38 why not do the same as matchesWithAncestors: var e
Emily Fortuna 2013/10/30 23:30:20 Same difference. Done.
54 if (target.matches(_selector)) { 54 if (target.matches(_selector)) {
55 matchedTarget = target; 55 matchedTarget = target;
56 } 56 }
57 target = target.parent; 57 target = target.parent;
58 } 58 }
59 return matchedTarget; 59 return matchedTarget;
60 } 60 }
61 $!MEMBERS 61 $!MEMBERS
62 } 62 }
OLDNEW
« no previous file with comments | « tests/html/element_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698