mirror of
https://github.com/jlengrand/webcomponentsjs.git
synced 2026-03-10 08:51:22 +00:00
Defers whenReady until after any imports that are queued by custom elements upgrading have been loaded.
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
let cb = flushCallback;
|
||||
flushCallback = null;
|
||||
cb();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
let origWhenReady = HTMLImports.whenReady;
|
||||
@@ -31,8 +32,14 @@
|
||||
|
||||
HTMLImports.whenReady = function(cb) {
|
||||
origWhenReady(function() {
|
||||
runAndClearCallback();
|
||||
cb();
|
||||
// custom element code may add dynamic imports
|
||||
// to match processing of native custom elements before
|
||||
// domContentLoaded, we wait for these imports to resolve first.
|
||||
if (runAndClearCallback()) {
|
||||
origWhenReady(cb);
|
||||
} else {
|
||||
cb();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user