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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.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:
Download patch
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index eb831c073f31928cb771e64492cb23d547e5829e..167809c0843f55c3cbae7c77fd69419e78ca656a 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -32333,6 +32333,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;
}
@@ -32340,6 +32342,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;
}
@@ -32352,6 +32356,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 | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698