mirror of
https://github.com/less/less.js.git
synced 2026-02-09 22:45:28 -05:00
merge in latest 1.7.1 release
This commit is contained in:
@@ -123,13 +123,7 @@ function createCSS(styles, sheet, lastModified) {
|
||||
}
|
||||
css.id = id;
|
||||
|
||||
if (css.styleSheet) { // IE
|
||||
try {
|
||||
css.styleSheet.cssText = styles;
|
||||
} catch (e) {
|
||||
throw new(Error)("Couldn't reassign styleSheet.cssText.");
|
||||
}
|
||||
} else {
|
||||
if (!css.styleSheet) {
|
||||
css.appendChild(document.createTextNode(styles));
|
||||
|
||||
// If new contents match contents of oldCss, don't replace oldCss
|
||||
@@ -153,6 +147,17 @@ function createCSS(styles, sheet, lastModified) {
|
||||
oldCss.parentNode.removeChild(oldCss);
|
||||
}
|
||||
|
||||
// For IE.
|
||||
// This needs to happen *after* the style element is added to the DOM, otherwise IE 7 and 8 may crash.
|
||||
// See http://social.msdn.microsoft.com/Forums/en-US/7e081b65-878a-4c22-8e68-c10d39c2ed32/internet-explorer-crashes-appending-style-element-to-head
|
||||
if (css.styleSheet) {
|
||||
try {
|
||||
css.styleSheet.cssText = styles;
|
||||
} catch (e) {
|
||||
throw new(Error)("Couldn't reassign styleSheet.cssText.");
|
||||
}
|
||||
}
|
||||
|
||||
// Don't update the local store if the file wasn't modified
|
||||
if (lastModified && cache) {
|
||||
log('saving ' + href + ' to cache.', logLevel.info);
|
||||
|
||||
Reference in New Issue
Block a user