Skip to content

Commit

Permalink
clear contents on TemplateElement#setInnerHtml before appending
Browse files Browse the repository at this point in the history
Fixes flutter#18249

Change-Id: I29b12163ad5809010c4ee4ff4ce892399d26e3ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112485
Reviewed-by: Terry Lucas <terry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
  • Loading branch information
srawlins authored and commit-bot@chromium.org committed Sep 6, 2019
1 parent c8f3f13 commit d964c50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion sdk/lib/html/dart2js/html_dart2js.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28281,11 +28281,12 @@ class TemplateElement extends HtmlElement {
*
* See also:
*
* * <https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html#innerhtml-on-templates>
* * <https://w3c.github.io/DOM-Parsing/#the-innerhtml-mixin>
*/
void setInnerHtml(String html,
{NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
text = null;
content.nodes.clear();
var fragment = createFragment(html,
validator: validator, treeSanitizer: treeSanitizer);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ $!MEMBERS
*
* See also:
*
* * <https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html#innerhtml-on-templates>
* * <https://w3c.github.io/DOM-Parsing/#the-innerhtml-mixin>
*/
void setInnerHtml(String html,
{NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
text = null;
content.nodes.clear();
var fragment = createFragment(
html, validator: validator, treeSanitizer: treeSanitizer);

Expand Down

0 comments on commit d964c50

Please sign in to comment.