Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: tools/dom/src/Validators.dart

Issue 23511007: Adding warning message when HTML contents get sanitized away. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/src/Validators.dart
diff --git a/tools/dom/src/Validators.dart b/tools/dom/src/Validators.dart
index 430658edc35992da95c04503832b9ca5cf74266a..5154a9d4e4e05c99d86ae4b4cf44f32c7b096de7 100644
--- a/tools/dom/src/Validators.dart
+++ b/tools/dom/src/Validators.dart
@@ -165,6 +165,8 @@ class _ValidatingTreeSanitizer implements NodeTreeSanitizer {
Element element = node;
var attrs = element.attributes;
if (!validator.allowsElement(element)) {
+ window.console.warn(
+ 'Removing disallowed element <${element.tagName}>');
element.remove();
break;
}
@@ -172,6 +174,8 @@ class _ValidatingTreeSanitizer implements NodeTreeSanitizer {
var isAttr = attrs['is'];
if (isAttr != null) {
if (!validator.allowsAttribute(element, 'is', isAttr)) {
+ window.console.warn('Removing disallowed type extension '
+ '<${element.tagName} is="$isAttr">');
element.remove();
break;
}
@@ -184,6 +188,8 @@ class _ValidatingTreeSanitizer implements NodeTreeSanitizer {
var name = keys[i];
if (!validator.allowsAttribute(element, name.toLowerCase(),
attrs[name])) {
+ window.console.warn('Removing disallowed attribute '
+ '<${element.tagName} $name="${attrs[name]}">');
attrs.remove(name);
}
}
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698