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

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

Issue 1123173003: Another try at appendHtml and insertAdjacentHtml should be consistently sanitized (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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 | « CHANGELOG.md ('k') | 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 7e8622fdc3d4db2553766b6e910037e3b65003b3..c96ee3c7f5ac75b1253aa6c901c549400b458323 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -9941,8 +9941,10 @@ class DocumentFragment extends Node implements ParentNode {
* Parses the specified text as HTML and adds the resulting node after the
* last child of this document fragment.
*/
- void appendHtml(String text) {
- this.append(new DocumentFragment.html(text));
+ void appendHtml(String text, {NodeValidator validator,
+ NodeTreeSanitizer, treeSanitizer}) {
+ this.append(new DocumentFragment.html(text, validator: validator,
+ treeSanitizer: treeSanitizer));
}
/**
@@ -12619,8 +12621,10 @@ abstract class Element extends Node implements GlobalEventHandlers, ParentNode,
* Parses the specified text as HTML and adds the resulting node after the
* last child of this element.
*/
- void appendHtml(String text) {
- this.insertAdjacentHtml('beforeend', text);
+ void appendHtml(String text, {NodeValidator validator,
+ NodeTreeSanitizer treeSanitizer}) {
+ this.insertAdjacentHtml('beforeend', text, validator: validator,
+ treeSanitizer: treeSanitizer);
}
/**
@@ -12865,6 +12869,7 @@ abstract class Element extends Node implements GlobalEventHandlers, ParentNode,
@JSName('insertAdjacentText')
void _insertAdjacentText(String where, String text) native;
+
/**
* Parses text as an HTML fragment and inserts it into the DOM at the
@@ -12888,14 +12893,13 @@ abstract class Element extends Node implements GlobalEventHandlers, ParentNode,
* * [insertAdjacentText]
* * [insertAdjacentElement]
*/
- void insertAdjacentHtml(String where, String html) {
- if (JS('bool', '!!#.insertAdjacentHTML', this)) {
- _insertAdjacentHtml(where, html);
- } else {
- _insertAdjacentNode(where, new DocumentFragment.html(html));
- }
+ void insertAdjacentHtml(String where, String html, {NodeValidator validator,
+ NodeTreeSanitizer treeSanitizer}) {
+ _insertAdjacentNode(where, new DocumentFragment.html(html,
+ validator: validator, treeSanitizer: treeSanitizer));
}
+
@JSName('insertAdjacentHTML')
void _insertAdjacentHtml(String where, String text) native;
« no previous file with comments | « CHANGELOG.md ('k') | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698