Forbid functions and mixins in control directives.

This commit is contained in:
Natalie Weizenbaum 2017-01-06 17:41:37 -08:00
parent 7ccccbc2ba
commit ce36eb5b10
2 changed files with 12 additions and 0 deletions

View File

@ -14,6 +14,8 @@
* Properly handle `@for` rules where each bound has a different unit.
* Forbid mixins and functions from being defined in control directives.
## 1.0.0-alpha.6
* Allow `var()` to be passed to `rgb()`, `rgba()`, `hsl()`, and `hsla()`.

View File

@ -550,6 +550,11 @@ abstract class StylesheetParser extends Parser {
"Mixins may not contain function declarations.",
scanner.spanFrom(start),
scanner.string);
} else if (_inControlDirective) {
throw new StringScannerException(
"Functions may not be declared in control directives.",
scanner.spanFrom(start),
scanner.string);
}
whitespace();
@ -767,6 +772,11 @@ abstract class StylesheetParser extends Parser {
"Mixins may not contain mixin declarations.",
scanner.spanFrom(start),
scanner.string);
} else if (_inControlDirective) {
throw new StringScannerException(
"Mixins may not be declared in control directives.",
scanner.spanFrom(start),
scanner.string);
}
whitespace();