|
17 | 17 | <link rel="import" href="../template/template-stamp.html">
|
18 | 18 | <link rel="import" href="../attributes/attribute-to-from-property.html">
|
19 | 19 | <link rel="import" href="../properties/meta-effects.html">
|
| 20 | +<link rel="import" href="../styling/style-lib.html"> |
20 | 21 |
|
21 | 22 | <script>
|
22 | 23 | (function() {
|
|
64 | 65 | this._observedAttributes = this.addPropertiesToAttributes(
|
65 | 66 | this._flattenedProperties, []);
|
66 | 67 | }
|
| 68 | + if (!Polymer.StyleLib.nativeShadow) { |
| 69 | + this.__placeholder = Polymer.StyleLib.applyStylePlaceHolder(this.is); |
| 70 | + } |
67 | 71 | return this._observedAttributes;
|
68 | 72 | }
|
69 | 73 |
|
|
112 | 116 | this.createMethodObservers(config.observers);
|
113 | 117 | if (this.template) {
|
114 | 118 | var template = this.prepareTemplate(this.template);
|
115 |
| - // TODO(dfreedm): remove when style stuff is refactored |
| 119 | + // TODO(dfreedm): remove when style stuff is refactored |
116 | 120 | // away from using element as input.
|
117 | 121 | proto.__notStyleScopeCacheable = template.__notStyleScopeCacheable;
|
118 | 122 | this.data.clearPropagateEffects(proto);
|
|
125 | 129 | static get template() {
|
126 | 130 | if (!this.hasOwnProperty('_template')) {
|
127 | 131 | // TODO(sorvell): `__importDoc` may not be set if super class
|
128 |
| - // has not run defined... falling back to document here is |
| 132 | + // has not run defined... falling back to document here is |
129 | 133 | // incorrect. This gambit cannot work as is since if the superclass
|
130 | 134 | // document cannot be discovered via the subclass.
|
131 | 135 | // TODO(sorvell): support more ways to acquire template.
|
132 | 136 | // this requires `is` on constructor...
|
133 |
| - this._template = Polymer.DomModule.import(this.is, |
| 137 | + this._template = Polymer.DomModule.import(this.is, |
134 | 138 | 'template', this.__importDoc || document);
|
135 | 139 | }
|
136 | 140 | return this._template;
|
|
141 | 145 | Polymer.CompatStyleUtil.normalizeForBC(template.content);
|
142 | 146 | // TODO(sorvell): cannot use `this` here, refactor this to only do
|
143 | 147 | // template preparation and take a name.
|
144 |
| - // TODO(dfreedm): factor so that we do not need an object/element |
| 148 | + // TODO(dfreedm): factor so that we do not need an object/element |
145 | 149 | // argument
|
146 | 150 | var info = {
|
147 | 151 | localName: this.is,
|
148 | 152 | is: this.is,
|
149 | 153 | extends: this.extends,
|
150 |
| - __cssBuild: this.__cssBuild |
| 154 | + __cssBuild: this.__cssBuild, |
| 155 | + __placeholder: this.__placeholder, |
151 | 156 | }
|
152 | 157 | Polymer.StyleLib.prepareTemplate(info, template);
|
153 | 158 | template.__notStyleScopeCacheable = info.__notStyleScopeCacheable;
|
|
168 | 173 | // add self to host's pending client list
|
169 | 174 | hostStack.registerHost(this);
|
170 | 175 | // apply defaults first.
|
171 |
| - this.constructor.data.setPropertyDefaults(this, |
| 176 | + this.constructor.data.setPropertyDefaults(this, |
172 | 177 | this.constructor._flattenedProperties);
|
173 | 178 | }
|
174 | 179 |
|
|
216 | 221 | var property = caseMap.dashToCamelCase(name);
|
217 | 222 | var type = this.constructor._flattenedProperties[property].type;
|
218 | 223 | if (!this.constructor.data.hasReadOnlyEffect(this, property)) {
|
219 |
| - this.constructor.attributes.attributeToProperty(this, |
| 224 | + this.constructor.attributes.attributeToProperty(this, |
220 | 225 | name, value, type);
|
221 | 226 | }
|
222 | 227 | }
|
|
0 commit comments