Is it possible to bypass the ShadowDOM polyfill in Dart?

Is it possible to bypass the .js framework when using it in a dart?

This is an example:

  final style = new dom.StyleElement()..text = css;
  dom.document.head.append(style);
  style.sheet.cssRules; //this is List<CssRule>

      

If, however, I add platform.js and dart_support.js from the web_components package I get:

  final style = new dom.StyleElement()..text = css;
  dom.document.head.append(style);
  style.sheet.cssRules; //this is UnknownJavaScriptObject

      

It looks like wrapping around elements is causing it. Is there a way to expand the dart dom element to fix this issue?

+3


source to share





All Articles