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

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 22529004: Add includeAncestors to dartium matches call. (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') | tests/html/html.status » ('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 1524bc973a44b81b02dee7cc814cb12a0f1cc80b..c555b337fc08f0adf31eb1dcf4e883ecf3d899fd 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -9734,6 +9734,23 @@ 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`.
+ */
+ @Experimental()
+ bool matches(String selectors, [includeAncestors = false]) {
+ var elem = this;
+ do {
+ if (elem._matches(selectors)) return true;
+ elem = elem.parent;
+ } while(includeAncestors && elem != null);
+ return false;
+ }
+
Element _templateInstanceRef;
// Note: only used if `this is! TemplateElement`
@@ -10494,7 +10511,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()
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698