Open ghost opened 6 years ago
Here is a potential workaround but I have not tested it extensively...
Iterable<CssStyleRule> findStyles(Element element) sync* {
for (final sheet in document.styleSheets.whereType<CssStyleSheet>()) {
if (sheet.disabled) continue;
if (!window.matchMedia(sheet.media.mediaText).matches) continue;
for(final rule in sheet.cssRules.whereType<CssStyleRule>()) {
if (element.matches(rule.selectorText)) yield rule;
}
}
}
Gives error:
As per MDN docs,
html.window.getComputedStyleMap()
should be replaced withwindow.getComputedStyle()
.https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle
At the moment
window.getComputedStyle()
is not available indart:html
package.dart sdk version: 2.0.0
Chromium version: Version 70.0.3538.67 (Official Build) Arch Linux (64-bit)