Index: tools/dom/src/Validators.dart |
diff --git a/tools/dom/src/Validators.dart b/tools/dom/src/Validators.dart |
index 11cb3d0d5ac642f9872959a9851baae3030c84da..809f8e58d2f89c68c42653038edbea87058fef7a 100644 |
--- a/tools/dom/src/Validators.dart |
+++ b/tools/dom/src/Validators.dart |
@@ -72,7 +72,7 @@ abstract class NodeTreeSanitizer { |
/** |
* A sanitizer for trees that we trust. It does no validation and allows |
* any elements. It is also more efficient, since it can pass the text |
- * directly through to the underlying APIs without creating a document |
+ * directly through to the underlying APIs without creating a document |
* fragment to be sanitized. |
*/ |
static const trusted = const _TrustedHtmlTreeSanitizer(); |
@@ -87,7 +87,7 @@ class _TrustedHtmlTreeSanitizer implements NodeTreeSanitizer { |
sanitizeTree(Node node) {} |
} |
- |
+ |
/** |
* Defines the policy for what types of uris are allowed for particular |
* attribute values. |
@@ -141,14 +141,14 @@ class _ThrowsNodeValidator implements NodeValidator { |
bool allowsElement(Element element) { |
if (!validator.allowsElement(element)) { |
- throw new ArgumentError(element._safeTagName); |
+ throw new ArgumentError(element.tagName); |
} |
return true; |
} |
bool allowsAttribute(Element element, String attributeName, String value) { |
if (!validator.allowsAttribute(element, attributeName, value)) { |
- throw new ArgumentError('${element._safeTagName}[$attributeName="$value"]'); |
+ throw new ArgumentError('${element.tagName}[$attributeName="$value"]'); |
} |
} |
} |
@@ -213,7 +213,10 @@ class _ValidatingTreeSanitizer implements NodeTreeSanitizer { |
try { |
elementText = element.toString(); |
} catch(e) {} |
- var elementTagName = element._safeTagName; |
+ var elementTagName = 'element tag unavailable'; |
+ try { |
+ elementTagName = element.tagName; |
+ } catch(e) {} |
_sanitizeElement(element, parent, corrupted, elementText, elementTagName, |
attrs, isAttr); |
} |