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

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

Side-by-side diff isn't available for this file because of its large size.
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:
Download patch
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tools/dom/scripts/htmlrenamer.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c555b337fc08f0adf31eb1dcf4e883ecf3d899fd..9801749bf19f27351d1fd5ac1b4bfaa6fad7eb5a 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -9734,20 +9734,14 @@ abstract class Element extends Node implements ParentNode, ChildNode {
}
- /**
- * 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;
}
@@ -10511,7 +10505,7 @@ abstract class Element extends Node implements ParentNode, ChildNode {
@DocsEditable()
@Experimental()
// http://dev.w3.org/2006/webapi/selectors-api2/#matches
- bool _matches(String selectors) native "Element_webkitMatchesSelector_Callback";
+ bool matches(String selectors) native "Element_webkitMatchesSelector_Callback";
@DomName('Element.webkitRequestFullScreen')
@DocsEditable()
@@ -30368,7 +30362,7 @@ class _ElementEventStreamImpl<T extends Event> extends _EventStream<T>
super(target, eventType, useCapture);
Stream<T> matches(String selector) =>
- this.where((event) => event.target.matches(selector, true));
+ this.where((event) => event.target.matchesWithAncestors(selector));
}
/**
@@ -30390,7 +30384,7 @@ class _ElementListEventStreamImpl<T extends Event> extends Stream<T>
}
Stream<T> matches(String selector) =>
- this.where((event) => event.target.matches(selector, true));
+ this.where((event) => event.target.matchesWIthAncestors(selector));
// Delegate all regular Stream behavor to our wrapped Stream.
StreamSubscription<T> listen(void onData(T event),
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tools/dom/scripts/htmlrenamer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698