This commit is contained in:
Luke Page
2014-05-11 07:45:17 +01:00
4 changed files with 26 additions and 8 deletions

View File

@@ -118,13 +118,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
@@ -148,6 +142,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);

View File

@@ -283,7 +283,7 @@ tree.mixin.Definition.prototype = {
matchCondition: function (args, env) {
if (this.condition && !this.condition.eval(
new(tree.evalEnv)(env,
[this.evalParams(env, new(tree.evalEnv)(env, this.frames.concat(env.frames)), args, [])] // the parameter variables
[this.evalParams(env, new(tree.evalEnv)(env, this.frames ? this.frames.concat(env.frames) : env.frames), args, [])] // the parameter variables
.concat(this.frames) // the parent namespace/mixin frames
.concat(env.frames)))) { // the current environment frames
return false;

View File

@@ -88,3 +88,6 @@
a: 1;
x: 1;
}
.mixin-generated-class {
a: 1;
}

View File

@@ -161,3 +161,13 @@
}
}
.bug-100cm-1m(100cm);
#ns {
.mixin-for-root-usage(@a) when (@a > 0) {
.mixin-generated-class {
a: @a;
}
}
}
#ns > .mixin-for-root-usage(1);