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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Side-by-side diff isn't available for this file because of its large size.
Issue 23793004: Adding an easy way to allow inline style attributes through sanitization (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 a6b0e8154f4023b46014e3567796d8b470bc4129..8836e33faea532bce9eb7f4ea05f04377b51a520 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -30821,6 +30821,21 @@ class NodeValidatorBuilder implements NodeValidator {
}
/**
+ * Allow inline styles on elements.
+ *
+ * If [tagName] is not specified then this allows inline styles on all
+ * elements. Otherwise tagName limits the styles to the specified elements.
+ */
+ void allowInlineStyles({String tagName}) {
+ if (tagName == null) {
+ tagName = '*';
+ } else {
+ tagName = tagName.toUpperCase();
+ }
+ add(new _SimpleNodeValidator(null, allowedAttributes: ['$tagName::style']));
+ }
+
+ /**
* Allow common safe HTML5 elements and attributes.
*
* This list is based off of the Caja whitelists at:
« 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