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

Unified Diff: chrome/browser/resources/i18n_template.js

Issue 155884: Fix issue where error pages inserted HTML from a template but the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/i18n_template.js
===================================================================
--- chrome/browser/resources/i18n_template.js (revision 21075)
+++ chrome/browser/resources/i18n_template.js (working copy)
@@ -56,6 +56,11 @@
}
if (object) {
object[path] = value;
+ // In case we set innerHTML (ignoring others) we need to
+ // recursively check the content
+ if (path == 'innerHTML') {
+ process(element, obj);
+ }
}
} else {
element.setAttribute(propName, value);
@@ -71,21 +76,23 @@
}
var selector = '[' + attributeNames.join('],[') + ']';
- return {
- /**
- * Processes a DOM tree with the {@code obj} map.
- */
- process: function(node, obj) {
- var elements = node.querySelectorAll(selector);
- for (var element, i = 0; element = elements[i]; i++) {
- for (var j = 0; j < attributeNames.length; j++) {
- var name = attributeNames[j];
- var att = element.getAttribute(name);
- if (att != null) {
- handlers[name](element, att, obj);
- }
+ /**
+ * Processes a DOM tree with the {@code obj} map.
+ */
+ function process(node, obj) {
+ var elements = node.querySelectorAll(selector);
+ for (var element, i = 0; element = elements[i]; i++) {
+ for (var j = 0; j < attributeNames.length; j++) {
+ var name = attributeNames[j];
+ var att = element.getAttribute(name);
+ if (att != null) {
+ handlers[name](element, att, obj);
}
}
}
+ }
+
+ return {
+ process: process
};
})();
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698