@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121THE SOFTWARE.
2222
2323*/
24- /* Build time: 3 -February-2012 11:27:02 */
24+ /* Build time: 10 -February-2012 02:23:58 */
2525
2626/*!
2727Parser-Lib
@@ -46,7 +46,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
4646THE SOFTWARE.
4747
4848*/
49- /* Version v0.1.4 , Build time: 31-January -2012 10:55:24 */
49+ /* Version v0.1.5 , Build time: 10-February -2012 12:59:26 */
5050var parserlib = { } ;
5151( function ( ) {
5252
@@ -956,7 +956,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
956956THE SOFTWARE.
957957
958958*/
959- /* Version v0.1.4 , Build time: 31-January -2012 10:55:24 */
959+ /* Version v0.1.5 , Build time: 10-February -2012 12:59:26 */
960960( function ( ) {
961961var EventTarget = parserlib . util . EventTarget ,
962962TokenStreamBase = parserlib . util . TokenStreamBase ,
@@ -3624,6 +3624,7 @@ var Properties = {
36243624 "border-right-color" : "<color> | inherit" ,
36253625 "border-right-style" : "<border-style>" ,
36263626 "border-right-width" : "<border-width>" ,
3627+ "border-spacing" : { multi : "<length> | inherit" , max : 2 } ,
36273628 "border-style" : { multi : "<border-style>" , max : 4 } ,
36283629 "border-top" : "<border-width> || <border-style> || <color>" ,
36293630 "border-top-color" : "<color> | inherit" ,
@@ -5563,7 +5564,7 @@ var Tokens = [
55635564 //{ name: "ATKEYWORD"},
55645565
55655566 //CSS3 animations
5566- { name : "KEYFRAMES_SYM" , text : [ "@keyframes" , "@-webkit-keyframes" , "@-moz-keyframes" ] } ,
5567+ { name : "KEYFRAMES_SYM" , text : [ "@keyframes" , "@-webkit-keyframes" , "@-moz-keyframes" , "@-ms-keyframes" ] } ,
55675568
55685569 //important symbol
55695570 { name : "IMPORTANT_SYM" } ,
@@ -6303,7 +6304,7 @@ var CSSLint = (function(){
63036304 formatters = [ ] ,
63046305 api = new parserlib . util . EventTarget ( ) ;
63056306
6306- api . version = "0.9.5 " ;
6307+ api . version = "0.9.6 " ;
63076308
63086309 //-------------------------------------------------------------------------
63096310 // Rule Management
@@ -6633,48 +6634,68 @@ Reporter.prototype = {
66336634
66346635//expose for testing purposes
66356636CSSLint . _Reporter = Reporter ;
6636- /*
6637- * Utility functions that make life easier.
6638- */
6637+
6638+ /*global CSSLint*/
66396639
66406640/*
6641- * Adds all properties from supplier onto receiver,
6642- * overwriting if the same name already exists on
6643- * reciever.
6644- * @param {Object } The object to receive the properties.
6645- * @param {Object } The object to provide the properties.
6646- * @return {Object } The receiver
6641+ * Utility functions that make life easier.
66476642 */
6648- function mix ( receiver , supplier ) {
6649- var prop ;
6643+ CSSLint . Util = {
6644+ /*
6645+ * Adds all properties from supplier onto receiver,
6646+ * overwriting if the same name already exists on
6647+ * reciever.
6648+ * @param {Object } The object to receive the properties.
6649+ * @param {Object } The object to provide the properties.
6650+ * @return {Object } The receiver
6651+ */
6652+ mix : function ( receiver , supplier ) {
6653+ var prop ;
66506654
6651- for ( prop in supplier ) {
6652- if ( supplier . hasOwnProperty ( prop ) ) {
6653- receiver [ prop ] = supplier [ prop ] ;
6655+ for ( prop in supplier ) {
6656+ if ( supplier . hasOwnProperty ( prop ) ) {
6657+ receiver [ prop ] = supplier [ prop ] ;
6658+ }
66546659 }
6655- }
66566660
6657- return prop ;
6658- }
6661+ return prop ;
6662+ } ,
66596663
6660- /*
6661- * Polyfill for array indexOf() method.
6662- * @param {Array } values The array to search.
6663- * @param {Variant } value The value to search for.
6664- * @return {int } The index of the value if found, -1 if not.
6665- */
6666- function indexOf ( values , value ) {
6667- if ( values . indexOf ) {
6668- return values . indexOf ( value ) ;
6669- } else {
6670- for ( var i = 0 , len = values . length ; i < len ; i ++ ) {
6671- if ( values [ i ] === value ) {
6672- return i ;
6664+ /*
6665+ * Polyfill for array indexOf() method.
6666+ * @param {Array } values The array to search.
6667+ * @param {Variant } value The value to search for.
6668+ * @return {int } The index of the value if found, -1 if not.
6669+ */
6670+ indexOf : function ( values , value ) {
6671+ if ( values . indexOf ) {
6672+ return values . indexOf ( value ) ;
6673+ } else {
6674+ for ( var i = 0 , len = values . length ; i < len ; i ++ ) {
6675+ if ( values [ i ] === value ) {
6676+ return i ;
6677+ }
6678+ }
6679+ return - 1 ;
6680+ }
6681+ } ,
6682+
6683+ /*
6684+ * Polyfill for array forEach() method.
6685+ * @param {Array } values The array to operate on.
6686+ * @param {Function } func The function to call on each item.
6687+ * @return {void }
6688+ */
6689+ forEach : function ( values , func ) {
6690+ if ( values . forEach ) {
6691+ return values . forEach ( func ) ;
6692+ } else {
6693+ for ( var i = 0 , len = values . length ; i < len ; i ++ ) {
6694+ func ( values [ i ] , i , values ) ;
66736695 }
66746696 }
6675- return - 1 ;
66766697 }
6677- }
6698+ } ;
66786699/*global CSSLint*/
66796700/*
66806701 * Rule: Don't use adjoining classes (.foo.bar).
@@ -6928,6 +6949,7 @@ CSSLint.addRule({
69286949 "writing-mode" : "epub ms"
69296950 } ;
69306951
6952+
69316953 for ( prop in compatiblePrefixes ) {
69326954 if ( compatiblePrefixes . hasOwnProperty ( prop ) ) {
69336955 variations = [ ] ;
@@ -6944,8 +6966,8 @@ CSSLint.addRule({
69446966 } ) ;
69456967
69466968 parser . addListener ( "property" , function ( event ) {
6947- var name = event . property . text ;
6948- if ( applyTo . indexOf ( name ) > - 1 ) {
6969+ var name = event . property ;
6970+ if ( CSSLint . Util . indexOf ( applyTo , name . text ) > - 1 ) {
69496971 properties . push ( name ) ;
69506972 }
69516973 } ) ;
@@ -6973,15 +6995,17 @@ CSSLint.addRule({
69736995 for ( prop in compatiblePrefixes ) {
69746996 if ( compatiblePrefixes . hasOwnProperty ( prop ) ) {
69756997 variations = compatiblePrefixes [ prop ] ;
6976- if ( variations . indexOf ( name ) > - 1 ) {
6977- if ( propertyGroups [ prop ] === undefined ) {
6998+ if ( CSSLint . Util . indexOf ( variations , name . text ) > - 1 ) {
6999+ if ( ! propertyGroups [ prop ] ) {
69787000 propertyGroups [ prop ] = {
69797001 full : variations . slice ( 0 ) ,
6980- actual : [ ]
7002+ actual : [ ] ,
7003+ actualNodes : [ ]
69817004 } ;
69827005 }
6983- if ( propertyGroups [ prop ] . actual . indexOf ( name ) === - 1 ) {
6984- propertyGroups [ prop ] . actual . push ( name ) ;
7006+ if ( CSSLint . Util . indexOf ( propertyGroups [ prop ] . actual , name . text ) === - 1 ) {
7007+ propertyGroups [ prop ] . actual . push ( name . text ) ;
7008+ propertyGroups [ prop ] . actualNodes . push ( name ) ;
69857009 }
69867010 }
69877011 }
@@ -6997,9 +7021,9 @@ CSSLint.addRule({
69977021 if ( full . length > actual . length ) {
69987022 for ( i = 0 , len = full . length ; i < len ; i ++ ) {
69997023 item = full [ i ] ;
7000- if ( actual . indexOf ( item ) === - 1 ) {
7024+ if ( CSSLint . Util . indexOf ( actual , item ) === - 1 ) {
70017025 propertiesSpecified = ( actual . length === 1 ) ? actual [ 0 ] : ( actual . length == 2 ) ? actual . join ( " and " ) : actual . join ( ", " ) ;
7002- reporter . report ( "The property " + item + " is compatible with " + propertiesSpecified + " and should be included as well." , event . selectors [ 0 ] . line , event . selectors [ 0 ] . col , rule ) ;
7026+ reporter . report ( "The property " + item + " is compatible with " + propertiesSpecified + " and should be included as well." , value . actualNodes [ 0 ] . line , value . actualNodes [ 0 ] . col , rule ) ;
70037027 }
70047028 }
70057029
@@ -8709,7 +8733,7 @@ CSSLint.addFormatter({
87098733
87108734 if ( messages . length > 0 ) {
87118735 output . push ( "<file name=\"" + filename + "\">" ) ;
8712- messages . forEach ( function ( message , i ) {
8736+ CSSLint . Util . forEach ( messages , function ( message , i ) {
87138737 //ignore rollups for now
87148738 if ( ! message . rollup ) {
87158739 output . push ( "<error line=\"" + message . line + "\" column=\"" + message . col + "\" severity=\"" + message . type + "\"" +
@@ -8769,7 +8793,7 @@ CSSLint.addFormatter({
87698793 return options . quiet ? "" : filename + ": Lint Free!" ;
87708794 }
87718795
8772- messages . forEach ( function ( message , i ) {
8796+ CSSLint . Util . forEach ( messages , function ( message , i ) {
87738797 if ( message . rollup ) {
87748798 output += filename + ": " + capitalize ( message . type ) + " - " + message . message + "\n" ;
87758799 } else {
@@ -8834,7 +8858,7 @@ CSSLint.addFormatter({
88348858
88358859 if ( messages . length > 0 ) {
88368860 output . push ( "<file name=\"" + filename + "\">" ) ;
8837- messages . forEach ( function ( message , i ) {
8861+ CSSLint . Util . forEach ( messages , function ( message , i ) {
88388862 if ( message . rollup ) {
88398863 output . push ( "<issue severity=\"" + message . type + "\" reason=\"" + escapeSpecialCharacters ( message . message ) + "\" evidence=\"" + escapeSpecialCharacters ( message . evidence ) + "\"/>" ) ;
88408864 } else {
@@ -8902,7 +8926,7 @@ CSSLint.addFormatter({
89028926 if ( messages . length > 0 ) {
89038927
89048928 output . push ( "<file name=\"" + filename + "\">" ) ;
8905- messages . forEach ( function ( message , i ) {
8929+ CSSLint . Util . forEach ( messages , function ( message , i ) {
89068930 if ( message . rollup ) {
89078931 output . push ( "<issue severity=\"" + message . type + "\" reason=\"" + escapeSpecialCharacters ( message . message ) + "\" evidence=\"" + escapeSpecialCharacters ( message . evidence ) + "\"/>" ) ;
89088932 } else {
@@ -8965,7 +8989,7 @@ CSSLint.addFormatter({
89658989 shortFilename = filename . substring ( pos + 1 ) ;
89668990 }
89678991
8968- messages . forEach ( function ( message , i ) {
8992+ CSSLint . Util . forEach ( messages , function ( message , i ) {
89698993 output = output + "\n\n" + shortFilename ;
89708994 if ( message . rollup ) {
89718995 output += "\n" + ( i + 1 ) + ": " + message . type ;
0 commit comments