Skip to content

Commit

Permalink
Unblocking CSS #273.
Browse files Browse the repository at this point in the history
  • Loading branch information
apetrushin committed Jan 15, 2016
1 parent 4c08223 commit d6f379e
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions src/curl/plugin/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@
// only executes once (link.onload is acting as a flag)
if (isFinalized(link)) return;
finalize(link);
waitForDocumentComplete(function () { cb(link.sheet); });
cb(link.sheet);
}
// always try standard handler
loadHandler(link, load);
Expand Down Expand Up @@ -468,30 +468,6 @@
head.appendChild(link);
}

/**
* Keep checking for the document readyState to be "complete" since
* Chrome doesn't apply the styles to the document until that time.
* If we return before readyState == 'complete', Chrome may not have
* applied the styles, yet.
* Chrome only.
* @private
* @param cb
*/
function waitForDocumentComplete (cb) {
// this isn't exactly the same as domReady (when dom can be
// manipulated). it's later (when styles are applied).
// chrome needs this (and opera?)
function complete () {
if (isDocumentComplete()) {
cb();
}
else {
setTimeout(complete, 10);
}
}
complete();
}

/**
* Returns true if the documents' readyState == 'complete' or the
* document doesn't implement readyState.
Expand Down

0 comments on commit d6f379e

Please sign in to comment.