Index: tools/dom/src/Validators.dart |
diff --git a/tools/dom/src/Validators.dart b/tools/dom/src/Validators.dart |
index 572477037bad32afeedd662347e525359a5c188f..809f8e58d2f89c68c42653038edbea87058fef7a 100644 |
--- a/tools/dom/src/Validators.dart |
+++ b/tools/dom/src/Validators.dart |
@@ -68,9 +68,27 @@ abstract class NodeTreeSanitizer { |
* will mark the entire tree as unsafe. |
*/ |
void sanitizeTree(Node node); |
+ |
+ /** |
+ * 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 |
+ * fragment to be sanitized. |
+ */ |
+ static const trusted = const _TrustedHtmlTreeSanitizer(); |
} |
/** |
+ * A sanitizer for trees that we trust. It does no validation and allows |
+ * any elements. |
+ */ |
+class _TrustedHtmlTreeSanitizer implements NodeTreeSanitizer { |
+ const _TrustedHtmlTreeSanitizer(); |
+ |
+ sanitizeTree(Node node) {} |
+} |
+ |
+/** |
* Defines the policy for what types of uris are allowed for particular |
* attribute values. |
* |