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

Unified Diff: tools/dom/templates/html/impl/impl_Element.darttemplate

Issue 22305005: Make includeAncestors match a separate method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/dom/src/EventStreamProvider.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/impl/impl_Element.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_Element.darttemplate b/tools/dom/templates/html/impl/impl_Element.darttemplate
index 32fce298624f7e8a223e1eeec844be719d7d1fc8..501c9972f287def47dd5cd58dde7e29cdb864385 100644
--- a/tools/dom/templates/html/impl/impl_Element.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Element.darttemplate
@@ -879,7 +879,7 @@ $if DART2JS
* Checks if this element matches the CSS selectors.
*/
@Experimental()
- bool _matches(String selectors) {
+ bool matches(String selectors) {
if (JS('bool', '!!#.matches', this)) {
return JS('bool', '#.matches(#)', this, selectors);
} else if (JS('bool', '!!#.webkitMatchesSelector', this)) {
@@ -896,20 +896,14 @@ $if DART2JS
$else
$endif
- /**
- * Checks if this element matches the CSS selectors.
- *
- * If `includeAncestors` is true, we examine all of this element's parent
- * elements and also return true if any of its parent elements matches
- * `selectors`.
- */
+ /** Checks if this element or any of its parents match the CSS selectors. */
@Experimental()
- bool matches(String selectors, [includeAncestors = false]) {
+ bool matchesWithAncestors(String selectors) {
var elem = this;
do {
- if (elem._matches(selectors)) return true;
+ if (elem.matches(selectors)) return true;
elem = elem.parent;
- } while(includeAncestors && elem != null);
+ } while(elem != null);
return false;
}
« no previous file with comments | « tools/dom/src/EventStreamProvider.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698