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

Side by Side Diff: ui/webui/resources/js/i18n_template_no_process.js

Issue 1249623003: Change ::shadow to * /deep/ to stop relying on implementation bug. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** @typedef {Document|DocumentFragment|Element} */ 5 /** @typedef {Document|DocumentFragment|Element} */
6 var ProcessingRoot; 6 var ProcessingRoot;
7 7
8 /** 8 /**
9 * @fileoverview This is a simple template engine inspired by JsTemplates 9 * @fileoverview This is a simple template engine inspired by JsTemplates
10 * optimized for i18n. 10 * optimized for i18n.
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 117 }
118 }); 118 });
119 } 119 }
120 }; 120 };
121 121
122 var prefixes = ['']; 122 var prefixes = [''];
123 123
124 // Only look through shadow DOM when it's supported. As of April 2015, iOS 124 // Only look through shadow DOM when it's supported. As of April 2015, iOS
125 // Chrome doesn't support shadow DOM. 125 // Chrome doesn't support shadow DOM.
126 if (Element.prototype.createShadowRoot) 126 if (Element.prototype.createShadowRoot)
127 prefixes.push('::shadow '); 127 prefixes.push('* /deep/ ');
128 128
129 var attributeNames = Object.keys(handlers); 129 var attributeNames = Object.keys(handlers);
130 var selector = prefixes.map(function(prefix) { 130 var selector = prefixes.map(function(prefix) {
131 return prefix + '[' + attributeNames.join('], ' + prefix + '[') + ']'; 131 return prefix + '[' + attributeNames.join('], ' + prefix + '[') + ']';
132 }).join(', '); 132 }).join(', ');
133 133
134 /** 134 /**
135 * Processes a DOM tree using a |data| source to populate template values. 135 * Processes a DOM tree using a |data| source to populate template values.
136 * @param {!ProcessingRoot} root The root of the DOM tree to process. 136 * @param {!ProcessingRoot} root The root of the DOM tree to process.
137 * @param {!LoadTimeData} data The data to draw from. 137 * @param {!LoadTimeData} data The data to draw from.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 var attribute = element.getAttribute(name); 202 var attribute = element.getAttribute(name);
203 if (attribute != null) 203 if (attribute != null)
204 handlers[name](element, attribute, data, visited); 204 handlers[name](element, attribute, data, visited);
205 } 205 }
206 } 206 }
207 207
208 return { 208 return {
209 process: process 209 process: process
210 }; 210 };
211 }()); 211 }());
OLDNEW
« 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