refactor(dart): Format Dart code
Use the dart formatter to clean up all pure Dart code. Closes #4832
This commit is contained in:
@ -340,13 +340,13 @@ abstract class AbstractHtml5LibAdapter implements DomAdapter {
|
||||
throw 'not implemented';
|
||||
}
|
||||
|
||||
bool isPageRule(rule) => (rule.type == 6);
|
||||
bool isPageRule(rule) => (rule.type == 6);
|
||||
|
||||
bool isStyleRule(rule) => (rule.type == 1);
|
||||
|
||||
bool isMediaRule(rule) => (rule.type == 4);
|
||||
|
||||
bool isKeyframesRule(rule) => (rule.type == 7);
|
||||
bool isKeyframesRule(rule) => (rule.type == 7);
|
||||
|
||||
String getHref(element) {
|
||||
throw 'not implemented';
|
||||
|
@ -98,7 +98,7 @@ final _keyCodeToKeyMap = const {
|
||||
final bool _supportsTemplateElement = () {
|
||||
try {
|
||||
return new TemplateElement().content != null;
|
||||
} catch(_) {
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
}();
|
||||
@ -216,7 +216,8 @@ class BrowserDomAdapter extends GenericBrowserDomAdapter {
|
||||
String nodeName(Node el) => el.nodeName;
|
||||
String nodeValue(Node el) => el.nodeValue;
|
||||
String type(InputElement el) => el.type;
|
||||
Node content(TemplateElement el) => _supportsTemplateElement ? el.content : el;
|
||||
Node content(TemplateElement el) =>
|
||||
_supportsTemplateElement ? el.content : el;
|
||||
Node firstChild(el) => el.firstChild;
|
||||
Node nextSibling(Node el) => el.nextNode;
|
||||
Element parentElement(Node el) => el.parent;
|
||||
@ -456,7 +457,7 @@ class BrowserDomAdapter extends GenericBrowserDomAdapter {
|
||||
setGlobalVar(String path, value) {
|
||||
var parts = path.split('.');
|
||||
var obj = js.context;
|
||||
while(parts.length > 1) {
|
||||
while (parts.length > 1) {
|
||||
var name = parts.removeAt(0);
|
||||
if (obj.hasProperty(name)) {
|
||||
obj = obj[name];
|
||||
|
@ -18,22 +18,19 @@ List<EmulatedCssRule> parseAndEmulateCssRules(String css) {
|
||||
|
||||
/// Converts `csslib` [rules] to their emulated counterparts.
|
||||
List<EmulatedCssRule> emulateRules(Iterable<cssv.TreeNode> rules) {
|
||||
return rules
|
||||
.map((cssv.TreeNode node) {
|
||||
if (node is cssv.RuleSet) {
|
||||
if (node.declarationGroup.span.text.isEmpty) {
|
||||
// Skip CSS matchers with no bodies
|
||||
return null;
|
||||
}
|
||||
return new EmulatedCssStyleRule(node);
|
||||
} else if (node is cssv.MediaDirective) {
|
||||
return new EmulatedCssMedialRule(node);
|
||||
} else if (node is cssv.ImportDirective) {
|
||||
return new EmulatedCssImportRule(node);
|
||||
return rules.map((cssv.TreeNode node) {
|
||||
if (node is cssv.RuleSet) {
|
||||
if (node.declarationGroup.span.text.isEmpty) {
|
||||
// Skip CSS matchers with no bodies
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.where((r) => r != null)
|
||||
.toList();
|
||||
return new EmulatedCssStyleRule(node);
|
||||
} else if (node is cssv.MediaDirective) {
|
||||
return new EmulatedCssMedialRule(node);
|
||||
} else if (node is cssv.ImportDirective) {
|
||||
return new EmulatedCssImportRule(node);
|
||||
}
|
||||
}).where((r) => r != null).toList();
|
||||
}
|
||||
|
||||
/// Emulates [CSSRule](https://developer.mozilla.org/en-US/docs/Web/API/CSSRule)
|
||||
@ -98,8 +95,8 @@ class EmulatedMediaList {
|
||||
String mediaText;
|
||||
|
||||
EmulatedMediaList(cssv.MediaDirective directive) {
|
||||
this.mediaText = directive.mediaQueries
|
||||
.map((q) => q.span.text).join(' and ');
|
||||
this.mediaText =
|
||||
directive.mediaQueries.map((q) => q.span.text).join(' and ');
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user