| 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 b554609c25a574d0d8b2ca83d67ff216d9dd1d45..41dd22b49ee35b496f55c2e46c6b737a2bd8c4f8 100644
|
| --- a/tools/dom/templates/html/impl/impl_Element.darttemplate
|
| +++ b/tools/dom/templates/html/impl/impl_Element.darttemplate
|
| @@ -895,7 +895,18 @@ $if DART2JS
|
|
|
| /**
|
| * Checks if this element matches the CSS selectors.
|
| + *
|
| + * Use [supportsMatches] to check if this is supported on the current
|
| + * platform.
|
| + *
|
| + * See also:
|
| + *
|
| + * * [supportsMatches]
|
| */
|
| + @SupportedBrowser(SupportedBrowser.CHROME)
|
| + @SupportedBrowser(SupportedBrowser.FIREFOX)
|
| + @SupportedBrowser(SupportedBrowser.IE, '10')
|
| + @SupportedBrowser(SupportedBrowser.SAFARI)
|
| @Experimental
|
| bool matches(String selectors) {
|
| if (JS('bool', '!!#.matches', this)) {
|
| @@ -908,7 +919,28 @@ $if DART2JS
|
| return JS('bool', '#.msMatchesSelector(#)', this, selectors);
|
| }
|
| }
|
| +
|
| + /**
|
| + * Checks if the matches function is supported on the current platform.
|
| + *
|
| + * See also:
|
| + *
|
| + * * [matches]
|
| + */
|
| + static bool get supportsMatches {
|
| + var e = new DivElement();
|
| + return JS('bool', '!!(#.matches || #.webkitMatchesSelector || '
|
| + '#.mozMatchesSelector || #.msMatchesSelector)', e, e, e, e);
|
| + }
|
| $else
|
| + /**
|
| + * Checks if the matches function is supported on the current platform.
|
| + *
|
| + * See also:
|
| + *
|
| + * * [matches]
|
| + */
|
| + static bool get supportsMatches => true;
|
| $endif
|
|
|
| $!MEMBERS
|
|
|