File tree Expand file tree Collapse file tree 3 files changed +16
-9
lines changed Expand file tree Collapse file tree 3 files changed +16
-9
lines changed Original file line number Diff line number Diff line change 235
235
236
236
forcePolyfillAttachedStateSynchrony : function ( ) {
237
237
// Force synchrony in attachedCallback and detachedCallback where
238
- // implemented, in the event that we are dealing with the async Web
239
- // Components Polyfill.
240
- if ( window . CustomElements && window . CustomElements . takeRecords ) {
238
+ // implemented, in the event that we are dealing with one of these async
239
+ // polyfills:
240
+ // 1. Web Components CustomElements polyfill (v1 or v0).
241
+ if ( window . customElements && window . customElements . flush ) {
242
+ window . customElements . flush ( ) ;
243
+ } else if ( window . CustomElements && window . CustomElements . takeRecords ) {
241
244
window . CustomElements . takeRecords ( ) ;
242
245
}
243
- // Force synchrony in ShadyDOM in case we are dealing with the polyfill.
246
+ // 2. ShadyDOM polyfill.
244
247
if ( window . ShadyDOM ) {
245
248
window . ShadyDOM . flush ( ) ;
246
249
}
Original file line number Diff line number Diff line change 15
15
< script src ="../../webcomponentsjs/webcomponents-lite.js "> </ script >
16
16
< script src ="../../web-component-tester/browser.js "> </ script >
17
17
18
- < link rel ="import " href ="../../polymer/polymer.html ">
19
-
20
18
</ head >
21
19
< body >
22
20
< script >
23
21
WCT . loadSuites ( [
24
- 'test-fixture.html' ,
25
- 'test-fixture-v1.html' ,
26
- 'handle-multiple-registrations.html'
22
+ 'test-fixture.html' , // shady
23
+ 'test-fixture.html?dom=shadow' , // shadow
24
+ 'test-fixture-v1.html?wc-shadydom=true&wc-ce=true' , // shady
25
+ 'test-fixture-v1.html' , // shadow
26
+ 'handle-multiple-registrations.html' ,
27
27
] ) ;
28
28
</ script >
29
29
</ body >
Original file line number Diff line number Diff line change 21
21
< body >
22
22
< script >
23
23
( function ( ) {
24
+ // Flag to enable takeRecords/flush for CustomElements v1 polyfill.
25
+ // https://github.com/webcomponents/custom-elements#differences-from-spec
26
+ customElements . enableFlush = true ;
27
+
24
28
function XCustom ( ) {
25
29
if ( window . Reflect ) {
26
30
return Reflect . construct ( HTMLElement , [ ] , XCustom )
You can’t perform that action at this time.
0 commit comments