"Reverting 45351"

BUG=

Review URL: https://codereview.chromium.org//1097053006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45353 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
alanknight@google.com 2015-04-22 17:51:58 +00:00
parent e2c41789ee
commit 25c6f198f5
6 changed files with 25 additions and 57 deletions

View file

@ -2,14 +2,8 @@
### Core library changes
* In dart:html, appendHtml and insertAdjacentHtml now take validator
and treeSanitizer parameters, and the inputs are consistently sanitized.
* List iterators may not throw ConcurrentModificationError as eagerly in
release mode. In checked mode, the modification check is still as eager
as possible.
[r45198](https://code.google.com/p/dart/source/detail?r=45198),
* Update experimental Isolate API:
- Make priority parameters of `Isolate.ping` and `Isolate.kill` methods
- Make priorty parameters of `Isolate.ping` and `Isolate.kill` methods
a named parameter.
- Remove the `Isolate.AS_EVENT` priority.
- Add extra `response` parameter to `Isolate.ping` and

View file

@ -9932,10 +9932,8 @@ 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, {NodeValidator validator,
NodeTreeSanitizer, treeSanitizer}) {
this.append(new DocumentFragment.html(text, validator: validator,
treeSanitizer: treeSanitizer));
void appendHtml(String text) {
this.append(new DocumentFragment.html(text));
}
/**
@ -12612,10 +12610,8 @@ 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, {NodeValidator validator,
NodeTreeSanitizer treeSanitizer}) {
this.insertAdjacentHtml('beforeend', text, validator: validator,
treeSanitizer: treeSanitizer);
void appendHtml(String text) {
this.insertAdjacentHtml('beforeend', text);
}
/**
@ -12894,10 +12890,12 @@ abstract class Element extends Node implements GlobalEventHandlers, ParentNode,
* * [insertAdjacentText]
* * [insertAdjacentElement]
*/
void insertAdjacentHtml(String where, String html, {NodeValidator validator,
NodeTreeSanitizer treeSanitizer}) {
_insertAdjacentNode(where, new DocumentFragment.html(html,
validator: validator, treeSanitizer: treeSanitizer));
void insertAdjacentHtml(String where, String html) {
if (JS('bool', '!!#.insertAdjacentHTML', this)) {
_insertAdjacentHtml(where, html);
} else {
_insertAdjacentNode(where, new DocumentFragment.html(html));
}
}
@JSName('insertAdjacentHTML')

View file

@ -9409,10 +9409,8 @@ 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, {NodeValidator validator,
NodeTreeSanitizer, treeSanitizer}) {
this.append(new DocumentFragment.html(text, validator: validator,
treeSanitizer: treeSanitizer));
void appendHtml(String text) {
this.append(new DocumentFragment.html(text));
}
/**
@ -12254,10 +12252,8 @@ 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, {NodeValidator validator,
NodeTreeSanitizer treeSanitizer}) {
this.insertAdjacentHtml('beforeend', text, validator: validator,
treeSanitizer: treeSanitizer);
void appendHtml(String text) {
this.insertAdjacentHtml('beforeend', text);
}
/**

View file

@ -137,24 +137,6 @@ main() {
validateNodeTree(template.content, expectedContent);
});
test("appendHtml is sanitized", () {
var html = '<body background="s"></body><div></div>';
document.body.appendHtml('<div id="stuff"></div>');
var stuff = document.querySelector("#stuff");
stuff.appendHtml(html);
expect(stuff.childNodes.length, 1);
stuff.remove();
});
test("documentFragment.appendHtml is sanitized", () {
var html = '<div id="things></div>';
var fragment = new DocumentFragment.html(html);
fragment.appendHtml('<div id="bad"><script></script></div>');
expect(fragment.childNodes.length, 1);
expect(fragment.childNodes[0].id, "bad");
expect(fragment.childNodes[0].childNodes.length, 0);
});
});
group('URI_sanitization', () {

View file

@ -93,10 +93,8 @@ $endif
* Parses the specified text as HTML and adds the resulting node after the
* last child of this document fragment.
*/
void appendHtml(String text, {NodeValidator validator,
NodeTreeSanitizer, treeSanitizer}) {
this.append(new DocumentFragment.html(text, validator: validator,
treeSanitizer: treeSanitizer));
void appendHtml(String text) {
this.append(new DocumentFragment.html(text));
}
/**

View file

@ -727,10 +727,8 @@ $(ANNOTATIONS)$(NATIVESPEC)abstract class $CLASSNAME$EXTENDS$IMPLEMENTS {
* Parses the specified text as HTML and adds the resulting node after the
* last child of this element.
*/
void appendHtml(String text, {NodeValidator validator,
NodeTreeSanitizer treeSanitizer}) {
this.insertAdjacentHtml('beforeend', text, validator: validator,
treeSanitizer: treeSanitizer);
void appendHtml(String text) {
this.insertAdjacentHtml('beforeend', text);
}
/**
@ -1020,10 +1018,12 @@ $if DART2JS
* * [insertAdjacentText]
* * [insertAdjacentElement]
*/
void insertAdjacentHtml(String where, String html, {NodeValidator validator,
NodeTreeSanitizer treeSanitizer}) {
_insertAdjacentNode(where, new DocumentFragment.html(html,
validator: validator, treeSanitizer: treeSanitizer));
void insertAdjacentHtml(String where, String html) {
if (JS('bool', '!!#.insertAdjacentHTML', this)) {
_insertAdjacentHtml(where, html);
} else {
_insertAdjacentNode(where, new DocumentFragment.html(html));
}
}
@JSName('insertAdjacentHTML')