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

Unified Diff: ui/webui/resources/js/i18n_template_no_process.js

Issue 1062813007: If shadow DOM is not supported, search for i18n attributes without using the /deep/ selector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add existence check for window.document.body before window.document.body.createShadowRoot. Created 5 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9c951eeb89c084d8a43a472725f58f1d76433f47..6f1f71551569c037779a2938645f90ee6fd039c7 100644
--- a/ui/webui/resources/js/i18n_template_no_process.js
+++ b/ui/webui/resources/js/i18n_template_no_process.js
@@ -111,7 +111,14 @@ var i18nTemplate = (function() {
};
var attributeNames = Object.keys(handlers);
- var selector = 'html /deep/ [' + attributeNames.join('],[') + ']';
+ // Chrome for iOS must use Apple's UIWebView, which (as of April 2015) does
+ // not have native shadow DOM support. If shadow DOM is supported (or
+ // polyfilled), search for i18n attributes using the /deep/ selector;
+ // otherwise, do not attempt to search within the shadow DOM.
+ var selector =
+ (window.document.body && window.document.body.createShadowRoot) ?
+ 'html /deep/ [' + attributeNames.join('],[') + ']' :
Dan Beam 2015/06/23 23:33:12 so this is whining in the console now about /deep/
+ '[' + attributeNames.join('],[') + ']';
/**
* Processes a DOM tree with the {@code dictionary} map.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698