| Index: tests/html/node_validator_test.dart
|
| diff --git a/tests/html/node_validator_test.dart b/tests/html/node_validator_test.dart
|
| index 7f76762f6ac3e69564e036ac30b292c7dce8ee0e..ae25743266714b8c777efc47c55f5151201ddbea 100644
|
| --- a/tests/html/node_validator_test.dart
|
| +++ b/tests/html/node_validator_test.dart
|
| @@ -87,6 +87,11 @@ main() {
|
| '<div><script></script><script></script></div>',
|
| '<div></div>');
|
|
|
| + testHtml('blocks inline styles',
|
| + validator,
|
| + '<div style="background: red"></div>',
|
| + '<div></div>');
|
| +
|
| testHtml('blocks namespaced attributes',
|
| validator,
|
| '<div ns:foo="foo"></div>',
|
| @@ -373,6 +378,34 @@ main() {
|
| '<foreignobject width="100" height="150"></foreignobject>'
|
| '</svg>');
|
| });
|
| +
|
| + group('allowInlineStyles', () {
|
| + var validator = new NodeValidatorBuilder()
|
| + ..allowTextElements()
|
| + ..allowInlineStyles();
|
| +
|
| + testHtml('allows inline styles',
|
| + validator,
|
| + '<span style="background-color:red">text</span>');
|
| +
|
| + testHtml('blocks other attributes',
|
| + validator,
|
| + '<span class="red-span"></span>',
|
| + '<span></span>');
|
| +
|
| + validator = new NodeValidatorBuilder()
|
| + ..allowTextElements()
|
| + ..allowInlineStyles(tagName: 'span');
|
| +
|
| + testHtml('scoped allows inline styles on spans',
|
| + validator,
|
| + '<span style="background-color:red">text</span>');
|
| +
|
| + testHtml('scoped blocks inline styles on LIs',
|
| + validator,
|
| + '<li style="background-color:red">text</li>',
|
| + '<li>text</li>');
|
| + });
|
| });
|
|
|
| group('throws', () {
|
|
|