|
133 | 133 | var self = this;
|
134 | 134 | var fn = function(all, prefix, value, fallback) {
|
135 | 135 | var propertyValue = (self.valueForProperty(props[value], props) ||
|
136 |
| - (props[fallback] ? |
137 |
| - self.valueForProperty(props[fallback], props) : |
| 136 | + (props[fallback] ? |
| 137 | + self.valueForProperty(props[fallback], props) : |
138 | 138 | fallback));
|
139 | 139 | return prefix + (propertyValue || '');
|
140 | 140 | };
|
|
160 | 160 | }
|
161 | 161 | p = pp.join(':');
|
162 | 162 | }
|
163 |
| - parts[i] = (p && p.lastIndexOf(';') === p.length - 1) ? |
| 163 | + parts[i] = (p && p.lastIndexOf(';') === p.length - 1) ? |
164 | 164 | // strip trailing ;
|
165 | 165 | p.slice(0, -1) :
|
166 | 166 | p || '';
|
|
188 | 188 | // generates a unique key for these matches
|
189 | 189 | var o = [], i = 0;
|
190 | 190 | styleUtil.forRulesInStyles(styles, function(rule) {
|
191 |
| - // TODO(sorvell): we could trim the set of rules at declaration |
| 191 | + // TODO(sorvell): we could trim the set of rules at declaration |
192 | 192 | // time to only include ones that have properties
|
193 | 193 | if (!rule.propertyInfo) {
|
194 | 194 | self.decorateRule(rule);
|
|
212 | 212 | // collect any custom properties into `props`.
|
213 | 213 | scopePropertiesFromStyles: function(styles) {
|
214 | 214 | if (!styles._scopeStyleProperties) {
|
215 |
| - styles._scopeStyleProperties = |
| 215 | + styles._scopeStyleProperties = |
216 | 216 | this.selectedPropertiesFromStyles(styles, this.SCOPE_SELECTORS);
|
217 | 217 | }
|
218 | 218 | return styles._scopeStyleProperties;
|
|
225 | 225 | // :host(...) and then matching these against self.
|
226 | 226 | hostPropertiesFromStyles: function(styles) {
|
227 | 227 | if (!styles._hostStyleProperties) {
|
228 |
| - styles._hostStyleProperties = |
| 228 | + styles._hostStyleProperties = |
229 | 229 | this.selectedPropertiesFromStyles(styles, this.HOST_SELECTORS);
|
230 | 230 | }
|
231 | 231 | return styles._hostStyleProperties;
|
|
251 | 251 | var self = this;
|
252 | 252 | var hostSelector = styleTransformer
|
253 | 253 | ._calcHostScope(element.is, element.extends);
|
254 |
| - var rxHostSelector = element.extends ? |
255 |
| - '\\' + hostSelector.slice(0, -1) + '\\]' : |
| 254 | + var rxHostSelector = element.extends ? |
| 255 | + '\\' + hostSelector.slice(0, -1) + '\\]' : |
256 | 256 | hostSelector;
|
257 |
| - var hostRx = new RegExp(this.rx.HOST_PREFIX + rxHostSelector + |
| 257 | + var hostRx = new RegExp(this.rx.HOST_PREFIX + rxHostSelector + |
258 | 258 | this.rx.HOST_SUFFIX);
|
259 | 259 | return styleTransformer.elementStyles(element, function(rule) {
|
260 | 260 | self.applyProperties(rule, properties);
|
261 | 261 | if (rule.cssText && !nativeShadow) {
|
262 |
| - self._scopeSelector(rule, hostRx, hostSelector, |
| 262 | + self._scopeSelector(rule, hostRx, hostSelector, |
263 | 263 | element._scopeCssViaAttr, scopeSelector);
|
264 | 264 | }
|
265 | 265 | });
|
|
271 | 271 | _scopeSelector: function(rule, hostRx, hostSelector, viaAttr, scopeId) {
|
272 | 272 | rule.transformedSelector = rule.transformedSelector || rule.selector;
|
273 | 273 | var selector = rule.transformedSelector;
|
274 |
| - var scope = viaAttr ? '[' + styleTransformer.SCOPE_NAME + '~=' + |
275 |
| - scopeId + ']' : |
| 274 | + var scope = viaAttr ? '[' + styleTransformer.SCOPE_NAME + '~=' + |
| 275 | + scopeId + ']' : |
276 | 276 | '.' + scopeId;
|
277 | 277 | var parts = selector.split(',');
|
278 | 278 | for (var i=0, l=parts.length, p; (i<l) && (p=parts[i]); i++) {
|
|
299 | 299 |
|
300 | 300 | applyElementStyle: function(element, properties, selector, style) {
|
301 | 301 | // calculate cssText to apply
|
302 |
| - var cssText = style ? style.textContent || '' : |
303 |
| - this.transformStyles(element, properties, selector); |
| 302 | + var cssText = style ? style.textContent || '' : |
| 303 | + this.transformStyles(element, properties, selector); |
304 | 304 | // if shady and we have a cached style that is not style, decrement
|
305 | 305 | var s = element._customStyle;
|
306 | 306 | if (s && !nativeShadow && (s !== style)) {
|
|
320 | 320 | } else if (cssText) {
|
321 | 321 | // apply css after the scope style of the element to help with
|
322 | 322 | // style predence rules.
|
323 |
| - style = styleUtil.applyCss(cssText, selector, |
| 323 | + style = styleUtil.applyCss(cssText, selector, |
324 | 324 | nativeShadow ? element.root : null, element._scopeStyle);
|
325 | 325 | }
|
326 | 326 | }
|
|
350 | 350 | },
|
351 | 351 |
|
352 | 352 | rx: {
|
353 |
| - VAR_ASSIGN: /(?:^|[;\n]\s*)(--[\w-]*?):\s*(?:([^;{]*)|{([^}]*)})(?:(?=[;\n])|$)/gi, |
354 |
| - MIXIN_MATCH: /(?:^|\W+)@apply[\s]*\(([^)]*)\)/i, |
| 353 | + VAR_ASSIGN: /(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:([^;{]*)|{([^}]*)})(?:(?=[;\s}])|$)/gi, |
| 354 | + MIXIN_MATCH: /(?:^|\W+)@apply[\s]*\(([^)]*)\)/i, |
355 | 355 | // note, this supports:
|
356 | 356 | // var(--a)
|
357 | 357 | // var(--a, --b)
|
|
0 commit comments