Index: ui/webui/resources/js/i18n_template_no_process.js |
diff --git a/ui/webui/resources/js/i18n_template_no_process.js b/ui/webui/resources/js/i18n_template_no_process.js |
index 6f1f71551569c037779a2938645f90ee6fd039c7..44262810b0328671273ec433f4b6a5b0f2c24496 100644 |
--- a/ui/webui/resources/js/i18n_template_no_process.js |
+++ b/ui/webui/resources/js/i18n_template_no_process.js |
@@ -122,11 +122,11 @@ var i18nTemplate = (function() { |
/** |
* Processes a DOM tree with the {@code dictionary} map. |
- * @param {HTMLElement} node The root of the DOM tree to process. |
+ * @param {Document|Element} root The root of the DOM tree to process. |
* @param {LoadTimeData} dictionary The dictionary to draw from. |
*/ |
- function process(node, dictionary) { |
- var elements = node.querySelectorAll(selector); |
+ function process(root, dictionary) { |
+ var elements = root.querySelectorAll(selector); |
for (var element, i = 0; element = elements[i]; i++) { |
for (var j = 0; j < attributeNames.length; j++) { |
var name = attributeNames[j]; |
@@ -135,6 +135,9 @@ var i18nTemplate = (function() { |
handlers[name](element, attribute, dictionary); |
} |
} |
+ var doc = root instanceof Document ? root : root.ownerDocument; |
+ if (doc) |
+ doc.documentElement.classList.add('i18n-processed'); |
} |
return { |