W3cubDocs

/Dart 2

allowCustomElement method

void allowCustomElement (String tagName, { UriPolicy uriPolicy, Iterable<String> attributes, Iterable<String> uriAttributes })

Allow custom elements with the specified tag name and specified attributes.

This will allow the elements as custom tags (such as ), but will not allow tag extensions. Use allowTagExtension to allow tag extensions.

Implementation

void allowCustomElement(String tagName,
    {UriPolicy uriPolicy,
    Iterable<String> attributes,
    Iterable<String> uriAttributes}) {
  var tagNameUpper = tagName.toUpperCase();
  var attrs = attributes
      ?.map<String>((name) => '$tagNameUpper::${name.toLowerCase()}');
  var uriAttrs = uriAttributes
      ?.map<String>((name) => '$tagNameUpper::${name.toLowerCase()}');
  if (uriPolicy == null) {
    uriPolicy = new UriPolicy();
  }

  add(new _CustomElementNodeValidator(
      uriPolicy, [tagNameUpper], attrs, uriAttrs, false, true));
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/2.0.0/dart-html/NodeValidatorBuilder/allowCustomElement.html