diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart index 99469e28adf..ef5d16fe1f2 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. + */ + @Experimental() + bool matches(String selectors) { + if (JS('bool', '!!#.matches', this)) { + return JS('bool', '#.matches(#)', this, selectors); + } else if (JS('bool', '!!#.webkitMatchesSelector', this)) { + return JS('bool', '#.webkitMatchesSelector(#)', this, selectors); + } else if (JS('bool', '!!#.mozMatchesSelector', this)) { + return JS('bool', '#.mozMatchesSelector(#)', this, selectors); + } else if (JS('bool', '!!#.msMatchesSelector', this)) { + return JS('bool', '#.msMatchesSelector(#)', this, selectors); + } + throw new UnsupportedError("Not supported on this platform"); + } + Element _templateInstanceRef; // Note: only used if `this is! TemplateElement` @@ -25711,13 +25728,13 @@ class Url extends NativeFieldWrapperClass1 { if ((blob_OR_source_OR_stream is Blob || blob_OR_source_OR_stream == null)) { return _createObjectURL_1(blob_OR_source_OR_stream); } - if ((blob_OR_source_OR_stream is MediaStream || blob_OR_source_OR_stream == null)) { + if ((blob_OR_source_OR_stream is MediaSource || blob_OR_source_OR_stream == null)) { return _createObjectURL_2(blob_OR_source_OR_stream); } - if ((blob_OR_source_OR_stream is MediaSource || blob_OR_source_OR_stream == null)) { + if ((blob_OR_source_OR_stream is _WebKitMediaSource || blob_OR_source_OR_stream == null)) { return _createObjectURL_3(blob_OR_source_OR_stream); } - if ((blob_OR_source_OR_stream is _WebKitMediaSource || blob_OR_source_OR_stream == null)) { + if ((blob_OR_source_OR_stream is MediaStream || blob_OR_source_OR_stream == null)) { return _createObjectURL_4(blob_OR_source_OR_stream); } throw new ArgumentError("Incorrect number or type of arguments"); diff --git a/tools/dom/templates/html/impl/impl_Element.darttemplate b/tools/dom/templates/html/impl/impl_Element.darttemplate index e708395b059..8fde035acb2 100644 --- a/tools/dom/templates/html/impl/impl_Element.darttemplate +++ b/tools/dom/templates/html/impl/impl_Element.darttemplate @@ -874,6 +874,7 @@ $if DART2JS throw new ArgumentError("Invalid position ${where}"); } } +$endif /** * Checks if this element matches the CSS selectors. @@ -903,8 +904,6 @@ $if DART2JS } while(includeAncestors && elem != null); return false; } -$else -$endif $if DART2JS @Creates('Null') // Set from Dart code; does not instantiate a native type.