Permalink
Browse files

check for invalid directives in vendored keyframes blocks

  • Loading branch information...
1 parent 866d619 commit c5bcd3e4b578325400e66b42456430e71ed359ab @twalpole committed Jan 28, 2014
Showing with 23 additions and 1 deletion.
  1. +1 −1 lib/sass/tree/visitors/check_nesting.rb
  2. +22 −0 test/sass/scss/scss_test.rb
@@ -138,7 +138,7 @@ def invalid_return_parent?(parent, child)
Sass::Tree::CommentNode,
Sass::Tree::KeyframesBlockNode]
def invalid_directive_child?(parent, child)
- return unless parent.name == '@keyframes'
+ return unless parent.name =~ /@(?:-[a-z0-9]+-)?keyframes/
unless is_any_of?(child, VALID_KEYFRAMES_CHILDREN)
'Only keyframes blocks (e.g. "15% { ... }") are allowed within @keyframes.'
end
@@ -2936,6 +2936,16 @@ def test_no_extend_in_keyframes
SCSS
end
+ def test_no_extend_in_vendored_keyframes
+ assert_raise_message(Sass::SyntaxError, <<MESSAGE.rstrip) {render <<SCSS}
+Only keyframes blocks (e.g. "15% { ... }") are allowed within @keyframes.
+MESSAGE
+@-webkit-keyframes bounce {
+ @extend %foo;
+}
+SCSS
+ end
+
def test_no_extend_in_keyframes_rules
assert_raise_message(Sass::SyntaxError, <<MESSAGE.rstrip) {render <<SCSS}
Only properties are allowed within @keyframes blocks.
@@ -2948,6 +2958,18 @@ def test_no_extend_in_keyframes_rules
SCSS
end
+ def test_no_extend_in_vendored_keyframes_rules
+ assert_raise_message(Sass::SyntaxError, <<MESSAGE.rstrip) {render <<SCSS}
+Only properties are allowed within @keyframes blocks.
+MESSAGE
+@-webkit-keyframes bounce {
+ top {
+ @extend %foo;
+ }
+}
+SCSS
+ end
+
def test_nested_mixin_def_is_scoped
render <<SCSS
foo {

0 comments on commit c5bcd3e

Please sign in to comment.