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

Unified Diff: sdk/lib/html/dartium/html_dartium.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 | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tests/html/node_validator_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index 02e8a254d4eb3204e032349e4ff84cec7db6b77d..a9b11dda6e6251e497f9c5912ee489dc69b596ea 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -26119,13 +26119,13 @@ class Url extends NativeFieldWrapperClass1 {
if ((blob_OR_source_OR_stream is Blob || blob_OR_source_OR_stream == null)) {
return _createObjectURL_1(blob_OR_source_OR_stream);
}
- if ((blob_OR_source_OR_stream is MediaSource || blob_OR_source_OR_stream == null)) {
+ if ((blob_OR_source_OR_stream is MediaStream || blob_OR_source_OR_stream == null)) {
return _createObjectURL_2(blob_OR_source_OR_stream);
}
- if ((blob_OR_source_OR_stream is _WebKitMediaSource || blob_OR_source_OR_stream == null)) {
+ if ((blob_OR_source_OR_stream is MediaSource || blob_OR_source_OR_stream == null)) {
return _createObjectURL_3(blob_OR_source_OR_stream);
}
- if ((blob_OR_source_OR_stream is MediaStream || blob_OR_source_OR_stream == null)) {
+ if ((blob_OR_source_OR_stream is _WebKitMediaSource || blob_OR_source_OR_stream == null)) {
return _createObjectURL_4(blob_OR_source_OR_stream);
}
throw new ArgumentError("Incorrect number or type of arguments");
@@ -32874,6 +32874,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 | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tests/html/node_validator_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698