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

Side by Side Diff: third_party/pkg/angular/lib/tools/selector.dart

Issue 176943008: Update the Angular/DI tests to latest from github. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 library selector; 1 library selector;
2 2
3 import 'package:html5lib/dom.dart'; 3 import 'package:html5lib/dom.dart';
4 4
5 class ContainsSelector { 5 class ContainsSelector {
6 String selector; 6 String selector;
7 RegExp regexp; 7 RegExp regexp;
8 8
9 ContainsSelector(this.selector, regexp) { 9 ContainsSelector(this.selector, regexp) {
10 this.regexp = new RegExp(regexp); 10 this.regexp = new RegExp(regexp);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 String matchingKey = _matchingKey(node.attributes.keys, part.attrName); 104 String matchingKey = _matchingKey(node.attributes.keys, part.attrName);
105 if (matchingKey == null || part.attrValue == '' ? 105 if (matchingKey == null || part.attrValue == '' ?
106 node.attributes[matchingKey] == null : 106 node.attributes[matchingKey] == null :
107 node.attributes[matchingKey] != part.attrValue) { 107 node.attributes[matchingKey] != part.attrValue) {
108 stillGood = false; 108 stillGood = false;
109 } 109 }
110 } 110 }
111 }); 111 });
112 112
113 return stillGood; 113 return stillGood;
114 } else { 114 }
115 throw new ArgumentError('Unsupported Selector: $selector'); 115
116 } 116 throw new ArgumentError('Unsupported Selector: $selector');
117
118 switch(node.nodeType) {
119 case 1: // Element
120 break;
121 case 3: // Text Node
122 break;
123 }
124 return false;
125 } 117 }
126 118
127 String _matchingKey(Iterable keys, String attrName) => 119 String _matchingKey(Iterable keys, String attrName) =>
128 keys.firstWhere( 120 keys.firstWhere(
129 (key) => new RegExp('^${attrName.replaceAll('*', r'[\w\-]+')}\$').hasMat ch(key.toString()), 121 (key) => new RegExp('^${attrName.replaceAll('*', r'[\w\-]+')}\$').hasMat ch(key.toString()),
130 orElse: () => null); 122 orElse: () => null);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698