From d5804a90f3f6fe45b2b5abc5b20cb2ad67158cfd Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Thu, 10 Jun 2010 20:04:05 -0700 Subject: [PATCH] [Sass] Support -moz-calc. --- doc-src/SASS_CHANGELOG.md | 13 ++++++++++++- lib/sass/script/lexer.rb | 2 +- test/sass/scss/css_test.rb | 5 ++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/doc-src/SASS_CHANGELOG.md b/doc-src/SASS_CHANGELOG.md index 775953d7..affd2249 100644 --- a/doc-src/SASS_CHANGELOG.md +++ b/doc-src/SASS_CHANGELOG.md @@ -17,10 +17,21 @@ Any of the following conditions will cause a literal CSS `@import`: The former two conditions always worked, but the latter two are new. +## `-moz-calc` Support + +The new [`-moz-calc()` function](http://hacks.mozilla.org/2010/06/css3-calc/) in Firefox 4 +will now be properly parsed by Sass. +`calc()` was already supported, but because the parsing rules are different +than for normal CSS functions, this had to be expanded to include `-moz-calc`. + +In anticipation of wider browser support, in fact, +*any* function named `-*-calc` (such as `-webkit-calc` or `-ms-calc`) +will be parsed the same as the `calc` function. + ## Rails 3 Support Support for Rails 3 versions prior to beta 4 has been removed. -Upgrade to Rails 3.0.0.beta4 if you haven't already. +Upg rade to Rails 3.0.0.beta4 if you haven't already. ## 3.0.12 diff --git a/lib/sass/script/lexer.rb b/lib/sass/script/lexer.rb index c3387dcd..d5830420 100644 --- a/lib/sass/script/lexer.rb +++ b/lib/sass/script/lexer.rb @@ -292,7 +292,7 @@ MESSAGE end def special_fun - return unless str1 = scan(/(calc|expression|progid:[a-z\.]*)\(/i) + return unless str1 = scan(/((-[\w-]+-)?calc|expression|progid:[a-z\.]*)\(/i) str2, _ = Haml::Shared.balance(@scanner, ?(, ?), 1) c = str2.count("\n") old_line = @line diff --git a/test/sass/scss/css_test.rb b/test/sass/scss/css_test.rb index 902f3201..65b7fad8 100755 --- a/test/sass/scss/css_test.rb +++ b/test/sass/scss/css_test.rb @@ -382,7 +382,10 @@ SCSS def test_calc_function assert_parses <