Skip to content

Commit a32a5f4

Browse files
author
Neil Fraser
committed
Restore colours in Dart speedtest output.
1 parent 90272a3 commit a32a5f4

File tree

2 files changed

+58
-23
lines changed

2 files changed

+58
-23
lines changed

dart/tests/Speedtest.dart

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,19 @@ void launch(Event e) {
2020

2121
var ds = dmp.diff_prettyHtml(d);
2222
document.getElementById('outputdiv').setInnerHtml(
23-
'$ds<BR>Time: ${date_end.difference(date_start)} (h:mm:ss.mmm)');
23+
'$ds<BR>Time: ${date_end.difference(date_start)} (h:mm:ss.mmm)',
24+
validator: new TrustedNodeValidator());
2425
}
2526

2627
void main() {
2728
document.getElementById('launch').addEventListener('click', launch);
2829
document.getElementById('outputdiv').setInnerHtml('');
2930
}
31+
32+
/// A NodeValidator which allows any contents.
33+
/// The default validator strips 'style' attributes.
34+
class TrustedNodeValidator implements NodeValidator {
35+
bool allowsElement(Element element) => true;
36+
bool allowsAttribute(Element element, String attributeName, String value)
37+
=> true;
38+
}

dart/tests/Speedtest.dart.js

Lines changed: 48 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)