Skip to content

Commit

Permalink
Merge pull request #849 from webmixedreality/ready-state
Browse files Browse the repository at this point in the history
Bugfix readystate interactive before DOMContentLoaded
  • Loading branch information
Avaer Kazmer authored Mar 11, 2019
2 parents 88d5da0 + 665e554 commit e3409fd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Document.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ function initDocument (document, window) {
console.warn(err);
}

document.readyState = 'interactive';
document.dispatchEvent(new Event('readystatechange', {target: document}));

document.dispatchEvent(new Event('DOMContentLoaded', {
target: document,
bubbles: true,
Expand All @@ -187,15 +190,15 @@ function initDocument (document, window) {
console.warn(err);
}

document.readyState = 'interactive';
document.dispatchEvent(new Event('readystatechange', {target: document}));

document.dispatchEvent(new Event('DOMContentLoaded', {
target: document,
bubbles: true,
}));
}

document.readyState = 'interactive';
document.dispatchEvent(new Event('readystatechange', {target: document}));

document.readyState = 'complete';
document.dispatchEvent(new Event('readystatechange', {target: document}));

Expand Down

0 comments on commit e3409fd

Please sign in to comment.