Use goog.dom.safeHtmlToNode instead of deprecated htmlToDocumentFragment.

goog.dom.htmlToDocumentFragment is going to be removed in [] It is removed because its usage can cause XSS.

More information: []

Tested:
    TAP --sample for global presubmit queue
    []
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=116081948
This commit is contained in:
jakubvrana 2016-03-01 18:16:07 -08:00 committed by Justine Tunney
parent 0ef0c933d2
commit 1ecf3db5fc

View file

@ -21,6 +21,7 @@ goog.require('goog.dom.classlist');
goog.require('goog.dom.xml');
goog.require('goog.events.EventType');
goog.require('goog.format.JsonPrettyPrinter');
goog.require('goog.html.legacyconversions');
goog.require('goog.json');
goog.require('goog.testing.asserts');
goog.require('goog.testing.events');
@ -34,7 +35,8 @@ goog.require('goog.testing.net.XhrIo');
*/
registry.testing.addToDocument = function(html) {
goog.global.document.body.appendChild(
goog.dom.htmlToDocumentFragment(html));
goog.dom.safeHtmlToNode(
goog.html.legacyconversions.safeHtmlFromString(html)));
};