| Index: tools/dom/src/NodeValidatorBuilder.dart
|
| diff --git a/tools/dom/src/NodeValidatorBuilder.dart b/tools/dom/src/NodeValidatorBuilder.dart
|
| index 24f079b47488f3820612ca58c9b2a965d2953673..7e5bfaa277e3b5bf7ac154dfb961428c369cf563 100644
|
| --- a/tools/dom/src/NodeValidatorBuilder.dart
|
| +++ b/tools/dom/src/NodeValidatorBuilder.dart
|
| @@ -157,16 +157,10 @@ class NodeValidatorBuilder implements NodeValidator {
|
| Iterable<String> uriAttributes}) {
|
|
|
| var tagNameUpper = tagName.toUpperCase();
|
| - var attrs;
|
| - if (attributes != null) {
|
| - attrs =
|
| - attributes.map((name) => '$tagNameUpper::${name.toLowerCase()}');
|
| - }
|
| - var uriAttrs;
|
| - if (uriAttributes != null) {
|
| - uriAttrs =
|
| - uriAttributes.map((name) => '$tagNameUpper::${name.toLowerCase()}');
|
| - }
|
| + var attrs = attributes != null ?
|
| + attributes.map/*<String>*/((name) => '$tagNameUpper::${name.toLowerCase()}') : null;
|
| + var uriAttrs = uriAttributes != null ?
|
| + uriAttributes.map/*<String>*/((name) => '$tagNameUpper::${name.toLowerCase()}') : null;
|
| if (uriPolicy == null) {
|
| uriPolicy = new UriPolicy();
|
| }
|
| @@ -195,16 +189,8 @@ class NodeValidatorBuilder implements NodeValidator {
|
|
|
| var baseNameUpper = baseName.toUpperCase();
|
| var tagNameUpper = tagName.toUpperCase();
|
| - var attrs;
|
| - if (attributes != null) {
|
| - attrs =
|
| - attributes.map((name) => '$baseNameUpper::${name.toLowerCase()}');
|
| - }
|
| - var uriAttrs;
|
| - if (uriAttributes != null) {
|
| - uriAttrs =
|
| - uriAttributes.map((name) => '$baseNameUpper::${name.toLowerCase()}');
|
| - }
|
| + var attrs = attributes != null ? attributes.map/*<String>*/((name) => '$baseNameUpper::${name.toLowerCase()}') : null;
|
| + var uriAttrs = uriAttributes != null ? uriAttributes.map/*<String>*/((name) => '$baseNameUpper::${name.toLowerCase()}') : null;
|
| if (uriPolicy == null) {
|
| uriPolicy = new UriPolicy();
|
| }
|
| @@ -390,13 +376,12 @@ class _CustomElementNodeValidator extends _SimpleNodeValidator {
|
| Iterable<String> allowedUriAttributes,
|
| bool allowTypeExtension,
|
| bool allowCustomTag):
|
| -
|
| + this.allowTypeExtension = allowTypeExtension == true,
|
| + this.allowCustomTag = allowCustomTag == true,
|
| super(uriPolicy,
|
| allowedElements: allowedElements,
|
| allowedAttributes: allowedAttributes,
|
| - allowedUriAttributes: allowedUriAttributes),
|
| - this.allowTypeExtension = allowTypeExtension == true,
|
| - this.allowCustomTag = allowCustomTag == true;
|
| + allowedUriAttributes: allowedUriAttributes);
|
|
|
| bool allowsElement(Element element) {
|
| if (allowTypeExtension) {
|
| @@ -428,12 +413,12 @@ class _TemplatingNodeValidator extends _SimpleNodeValidator {
|
| final Set<String> _templateAttrs;
|
|
|
| _TemplatingNodeValidator():
|
| + _templateAttrs = new Set<String>.from(_TEMPLATE_ATTRS),
|
| super(null,
|
| allowedElements: [
|
| 'TEMPLATE'
|
| ],
|
| - allowedAttributes: _TEMPLATE_ATTRS.map((attr) => 'TEMPLATE::$attr')),
|
| - _templateAttrs = new Set<String>.from(_TEMPLATE_ATTRS) {
|
| + allowedAttributes: _TEMPLATE_ATTRS.map((attr) => 'TEMPLATE::$attr')) {
|
| }
|
|
|
| bool allowsAttribute(Element element, String attributeName, String value) {
|
|
|