File tree 3 files changed +38
-4
lines changed
3 files changed +38
-4
lines changed Original file line number Diff line number Diff line change 135
135
// for system overriding
136
136
_beforeClientsReady : function ( ) { } ,
137
137
_afterClientsReady : function ( ) { } ,
138
+ _beforeAttached : function ( ) { } ,
138
139
139
140
// normalize lifecycle: ensure attached occurs only after ready.
140
141
attachedCallback : function ( ) {
141
142
if ( this . _readied ) {
143
+ this . _beforeAttached ( ) ;
142
144
baseAttachedCallback . call ( this ) ;
143
145
} else {
144
146
this . _attachedPending = true ;
Original file line number Diff line number Diff line change 14
14
< script >
15
15
( function ( ) {
16
16
17
- var attachedCallback = Polymer . Base . attachedCallback ;
18
17
var serializeValueToAttribute = Polymer . Base . serializeValueToAttribute ;
19
18
20
19
var propertyUtils = Polymer . StyleProperties ;
44
43
this . _ownStylePropertyNames . length ) ;
45
44
} ,
46
45
47
- attachedCallback : function ( ) {
46
+ _beforeAttached : function ( ) {
48
47
// note: do this once automatically,
49
48
// then requires calling `updateStyles`
50
49
if ( ! this . _scopeSelector && this . _needsStyleProperties ( ) ) {
51
50
this . _updateStyleProperties ( ) ;
52
51
}
53
- attachedCallback . call ( this ) ;
54
52
} ,
55
53
56
54
_updateStyleProperties : function ( ) {
Original file line number Diff line number Diff line change 123
123
</ script >
124
124
</ dom-module >
125
125
126
+ < dom-module id ="x-has-if ">
127
+ < style >
128
+ .iffy {
129
+ border : var (--scope-var );
130
+ }
131
+ </ style >
132
+
133
+ < template >
134
+ < template is ="dom-if " if ="{{gogo}} ">
135
+ < div class ="iffy "> iffy</ div >
136
+ </ template >
137
+ </ template >
138
+ < script >
139
+ HTMLImports . whenReady ( function ( ) {
140
+ Polymer ( {
141
+ is : 'x-has-if' ,
142
+ properties : {
143
+ gogo : { value : true }
144
+ }
145
+ } ) ;
146
+ } ) ;
147
+ </ script >
148
+ </ dom-module >
149
+
126
150
< dom-module id ="x-scope ">
127
151
< style >
128
152
: host {
197
221
< div id ="calc "> Calc</ div >
198
222
< div id ="shadow "> Shadow</ div >
199
223
< x-host-property id ="hostProp "> </ x-host-property >
224
+ < x-has-if id ="iffy "> </ x-has-if >
200
225
</ template >
201
226
< script >
202
227
HTMLImports . whenReady ( function ( ) {
203
- Polymer ( { is : 'x-scope' } ) ;
228
+ Polymer ( {
229
+ is : 'x-scope'
230
+ } ) ;
204
231
} ) ;
205
232
</ script >
206
233
</ dom-module >
299
326
}
300
327
assertComputed ( styled . $ . child . $ . me , '2px' ) ;
301
328
} ) ;
329
+
330
+ test ( 'style properties with dom-if' , function ( ) {
331
+ var e = styled . $ . iffy ;
332
+ var c = Polymer . dom ( e . root ) . querySelector ( '.iffy' ) ;
333
+ assert . ok ( c , 'dom-if did not stamp' ) ;
334
+ assertComputed ( c , '1px' ) ;
335
+ } ) ;
302
336
303
337
} ) ;
304
338
You can’t perform that action at this time.
0 commit comments