Skip to content

Commit

Permalink
Merge remote branch 'nex3/master' into mixin_children
Browse files Browse the repository at this point in the history
* nex3/master:
  Support :any.
  • Loading branch information
chriseppstein committed Sep 13, 2011
2 parents d6c0aaa + 516a0c5 commit 731bbcf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions doc-src/SASS_CHANGELOG.md
Expand Up @@ -37,6 +37,11 @@
Note that the contents passed to the mixin are evaluated in the scope they are used,
not the scope of the mixin. {file:SASS_REFERENCE.md#variable_scope_and_style_blocks More on variable scoping.}

## `:any` Support

Previously, only the `:-moz-any` selector was supported; this has been expanded
to support any vendor prefix, as well as the plain `:any` selector.

### Backwards Incompatibilities -- Must Read!

* Parent selectors followed immediately by identifiers (e.g. `&foo`)
Expand Down
2 changes: 1 addition & 1 deletion lib/sass/scss/parser.rb
Expand Up @@ -625,7 +625,7 @@ def pseudo_expr
end

def negation
return unless name = tok(NOT) || tok(MOZ_ANY)
return unless name = tok(NOT) || tok(ANY)
ss
@expected = "selector"
sel = selector_comma_sequence
Expand Down
2 changes: 1 addition & 1 deletion lib/sass/scss/rx.rb
Expand Up @@ -110,7 +110,7 @@ def self.quote(str, flags = 0)
# Custom
HEXCOLOR = /\#[0-9a-fA-F]+/
INTERP_START = /#\{/
MOZ_ANY = quote(":-moz-any(", Regexp::IGNORECASE)
ANY = /:(-[-\w]+-)?any\(/i

STRING1_NOINTERP = /\"((?:[^\n\r\f\\"#]|#(?!\{)|\\#{NL}|#{ESCAPE})*)\"/
STRING2_NOINTERP = /\'((?:[^\n\r\f\\'#]|#(?!\{)|\\#{NL}|#{ESCAPE})*)\'/
Expand Down
4 changes: 3 additions & 1 deletion test/sass/scss/css_test.rb
Expand Up @@ -733,10 +733,12 @@ def test_negation_selectors
assert_selector_parses(':not(h1, h2, h3)')
end

def test_moz_any_selector
def test_any_selector
assert_selector_parses(':-moz-any(h1, h2, h3)')
assert_selector_parses(':-moz-any(.foo)')
assert_selector_parses(':-moz-any(foo bar, .baz > .bang)')
assert_selector_parses(':-webkit-any(foo bar, .baz > .bang)')
assert_selector_parses(':any(foo bar, .baz > .bang)')
end

def test_namespaced_selectors
Expand Down

0 comments on commit 731bbcf

Please sign in to comment.