| Index: third_party/polymer/v1_0/components-chromium/polymer/polymer-extracted.js
|
| diff --git a/third_party/polymer/v1_0/components-chromium/polymer/polymer-extracted.js b/third_party/polymer/v1_0/components-chromium/polymer/polymer-extracted.js
|
| index b40fbcd87e13b74e89db7029cfc7aad5f5970775..8446e8a67cc7505d547c892ae8f0c53cc42973cd 100644
|
| --- a/third_party/polymer/v1_0/components-chromium/polymer/polymer-extracted.js
|
| +++ b/third_party/polymer/v1_0/components-chromium/polymer/polymer-extracted.js
|
| @@ -1647,7 +1647,12 @@ if (prop.notify) {
|
| this._addPropertyEffect(p, 'notify', { event: Polymer.CaseMap.camelToDashCase(p) + '-changed' });
|
| }
|
| if (prop.reflectToAttribute) {
|
| -this._addPropertyEffect(p, 'reflect', { attribute: Polymer.CaseMap.camelToDashCase(p) });
|
| +var attr = Polymer.CaseMap.camelToDashCase(p);
|
| +if (attr[0] === '-') {
|
| +this._warn(this._logf('_addPropertyEffects', 'Property ' + p + ' cannot be reflected to attribute ' + attr + ' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.'));
|
| +} else {
|
| +this._addPropertyEffect(p, 'reflect', { attribute: attr });
|
| +}
|
| }
|
| if (prop.readOnly) {
|
| Polymer.Bind.ensurePropertyEffects(this, p);
|
| @@ -1730,6 +1735,9 @@ var part = note.parts[i];
|
| if (part.signature) {
|
| this._addAnnotatedComputationEffect(note, part, index);
|
| } else if (!part.literal) {
|
| +if (note.kind === 'attribute' && note.name[0] === '-') {
|
| +this._warn(this._logf('_addAnnotationEffect', 'Cannot set attribute ' + note.name + ' because "-" is not a valid attribute starting character'));
|
| +} else {
|
| this._addPropertyEffect(part.model, 'annotation', {
|
| kind: note.kind,
|
| index: index,
|
| @@ -1744,6 +1752,7 @@ negate: part.negate
|
| });
|
| }
|
| }
|
| +}
|
| },
|
| _addAnnotatedComputationEffect: function (note, part, index) {
|
| var sig = part.signature;
|
| @@ -2512,20 +2521,30 @@ this.forEachRule(r, styleRuleCallback, keyframesRuleCallback);
|
| }
|
| }
|
| },
|
| -applyCss: function (cssText, moniker, target, afterNode) {
|
| +applyCss: function (cssText, moniker, target, contextNode) {
|
| +var style = this.createScopeStyle(cssText, moniker);
|
| +target = target || document.head;
|
| +var after = contextNode && contextNode.nextSibling || target.firstChild;
|
| +this.__lastHeadApplyNode = style;
|
| +return target.insertBefore(style, after);
|
| +},
|
| +createScopeStyle: function (cssText, moniker) {
|
| var style = document.createElement('style');
|
| if (moniker) {
|
| style.setAttribute('scope', moniker);
|
| }
|
| style.textContent = cssText;
|
| -target = target || document.head;
|
| -if (!afterNode) {
|
| -var n$ = target.querySelectorAll('style[scope]');
|
| -afterNode = n$[n$.length - 1];
|
| -}
|
| -target.insertBefore(style, afterNode && afterNode.nextSibling || target.firstChild);
|
| return style;
|
| },
|
| +__lastHeadApplyNode: null,
|
| +applyStylePlaceHolder: function (moniker) {
|
| +var placeHolder = document.createComment(' Shady DOM styles for ' + moniker + ' ');
|
| +var after = this.__lastHeadApplyNode ? this.__lastHeadApplyNode.nextSibling : null;
|
| +var scope = document.head;
|
| +scope.insertBefore(placeHolder, after || scope.firstChild);
|
| +this.__lastHeadApplyNode = placeHolder;
|
| +return placeHolder;
|
| +},
|
| cssFromModules: function (moduleIds, warnIfNotFound) {
|
| var modules = moduleIds.trim().split(' ');
|
| var cssText = '';
|
| @@ -2842,20 +2861,20 @@ styleTransformer.element(element, this.is, this._scopeCssViaAttr);
|
| prepElement.call(this, element);
|
| },
|
| _prepStyles: function () {
|
| -if (this._encapsulateStyle === undefined) {
|
| -this._encapsulateStyle = !nativeShadow && Boolean(this._template);
|
| +if (!nativeShadow) {
|
| +this._scopeStyle = styleUtil.applyStylePlaceHolder(this.is);
|
| }
|
| +},
|
| +_prepShimStyles: function () {
|
| if (this._template) {
|
| +if (this._encapsulateStyle === undefined) {
|
| +this._encapsulateStyle = !nativeShadow;
|
| +}
|
| this._styles = this._collectStyles();
|
| var cssText = styleTransformer.elementStyles(this);
|
| this._prepStyleProperties();
|
| -var needsStatic = this._styles.length && !this._needsStyleProperties();
|
| -if (needsStatic || !nativeShadow) {
|
| -cssText = needsStatic ? cssText : ' ';
|
| -var style = styleUtil.applyCss(cssText, this.is, nativeShadow ? this._template.content : null);
|
| -if (!nativeShadow) {
|
| -this._scopeStyle = style;
|
| -}
|
| +if (!this._needsStyleProperties() && this._styles.length) {
|
| +styleUtil.applyCss(cssText, this.is, nativeShadow ? this._template.content : null, this._scopeStyle);
|
| }
|
| } else {
|
| this._styles = [];
|
| @@ -3498,8 +3517,11 @@ Polymer.Base._addFeature({
|
| _registerFeatures: function () {
|
| this._prepIs();
|
| this._prepConstructor();
|
| -this._prepTemplate();
|
| this._prepStyles();
|
| +},
|
| +_finishRegisterFeatures: function () {
|
| +this._prepTemplate();
|
| +this._prepShimStyles();
|
| this._prepAnnotations();
|
| this._prepEffects();
|
| this._prepBehaviors();
|
|
|