Skip to content

Add CSS2 system colors #38 #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 20, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 47 additions & 11 deletions build/node-parserlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

*/
/* Version v@VERSION@, Build time: 16-November-2012 11:43:35 */
/* Version v@VERSION@, Build time: 19-November-2012 08:31:03 */
var parserlib = {};
(function(){

Expand Down Expand Up @@ -931,7 +931,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

*/
/* Version v@VERSION@, Build time: 16-November-2012 11:43:35 */
/* Version v@VERSION@, Build time: 19-November-2012 08:31:03 */
(function(){
var EventTarget = parserlib.util.EventTarget,
TokenStreamBase = parserlib.util.TokenStreamBase,
Expand Down Expand Up @@ -1080,7 +1080,36 @@ var Colors = {
white :"#ffffff",
whitesmoke :"#f5f5f5",
yellow :"#ffff00",
yellowgreen :"#9acd32"
yellowgreen :"#9acd32",
//CSS2 system colors http://www.w3.org/TR/css3-color/#css2-system
activeBorder :"Active window border.",
activecaption :"Active window caption.",
appworkspace :"Background color of multiple document interface.",
background :"Desktop background.",
buttonface :"The face background color for 3-D elements that appear 3-D due to one layer of surrounding border.",
buttonhighlight :"The color of the border facing the light source for 3-D elements that appear 3-D due to one layer of surrounding border.",
buttonshadow :"The color of the border away from the light source for 3-D elements that appear 3-D due to one layer of surrounding border.",
buttontext :"Text on push buttons.",
captiontext :"Text in caption, size box, and scrollbar arrow box.",
graytext :"Grayed (disabled) text. This color is set to #000 if the current display driver does not support a solid gray color.",
highlight :"Item(s) selected in a control.",
highlighttext :"Text of item(s) selected in a control.",
inactiveborder :"Inactive window border.",
inactivecaption :"Inactive window caption.",
inactivecaptiontext :"Color of text in an inactive caption.",
infobackground :"Background color for tooltip controls.",
infotext :"Text color for tooltip controls.",
menu :"Menu background.",
menutext :"Text in menus.",
scrollbar :"Scroll bar gray area.",
threeddarkshadow :"The color of the darker (generally outer) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
threedface :"The face background color for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
threedhighlight :"The color of the lighter (generally outer) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
threedlightshadow :"The color of the darker (generally inner) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
threedshadow :"The color of the lighter (generally inner) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
window :"Window background.",
windowframe :"Window frame.",
windowtext :"Text in windows."
};
/*global SyntaxUnit, Parser*/
/**
Expand Down Expand Up @@ -1908,18 +1937,21 @@ Parser.prototype = function(){
});
},

_operator: function(){
_operator: function(inFunction){

/*
* operator
* operator (outside function)
* : '/' S* | ',' S* | /( empty )/
* operator (inside function)
* : '/' S* | '+' S* | '*' S* | '-' S* /( empty )/
* ;
*/

var tokenStream = this._tokenStream,
token = null;

if (tokenStream.match([Tokens.SLASH, Tokens.COMMA])){
if (tokenStream.match([Tokens.SLASH, Tokens.COMMA]) ||
(inFunction && tokenStream.match([Tokens.PLUS, Tokens.STAR, Tokens.MINUS]))){
token = tokenStream.token();
this._readWhitespace();
}
Expand Down Expand Up @@ -2706,7 +2738,7 @@ Parser.prototype = function(){
return result;
},

_expr: function(){
_expr: function(inFunction){
/*
* expr
* : term [ operator term ]*
Expand All @@ -2725,8 +2757,8 @@ Parser.prototype = function(){
values.push(value);

do {
operator = this._operator();
operator = this._operator(inFunction);

//if there's an operator, keep building up the value parts
if (operator){
values.push(operator);
Expand Down Expand Up @@ -2862,7 +2894,7 @@ Parser.prototype = function(){
if (tokenStream.match(Tokens.FUNCTION)){
functionText = tokenStream.token().value;
this._readWhitespace();
expr = this._expr();
expr = this._expr(true);
functionText += expr;

//START: Horrible hack in case it's an IE filter
Expand Down Expand Up @@ -6061,7 +6093,11 @@ var ValidationTypes = {
},

"<length>": function(part){
return part.type == "length" || part.type == "number" || part.type == "integer" || part == "0";
if (part.type == "function" && /^(?:\-(?:ms|moz|o|webkit)\-)?calc/i.test(part)){
return true;
}else{
return part.type == "length" || part.type == "number" || part.type == "integer" || part == "0";
}
},

"<color>": function(part){
Expand Down
58 changes: 47 additions & 11 deletions build/npm/lib/node-parserlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

*/
/* Version v@VERSION@, Build time: 16-November-2012 11:43:35 */
/* Version v@VERSION@, Build time: 19-November-2012 08:31:03 */
var parserlib = {};
(function(){

Expand Down Expand Up @@ -931,7 +931,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

*/
/* Version v@VERSION@, Build time: 16-November-2012 11:43:35 */
/* Version v@VERSION@, Build time: 19-November-2012 08:31:03 */
(function(){
var EventTarget = parserlib.util.EventTarget,
TokenStreamBase = parserlib.util.TokenStreamBase,
Expand Down Expand Up @@ -1080,7 +1080,36 @@ var Colors = {
white :"#ffffff",
whitesmoke :"#f5f5f5",
yellow :"#ffff00",
yellowgreen :"#9acd32"
yellowgreen :"#9acd32",
//CSS2 system colors http://www.w3.org/TR/css3-color/#css2-system
activeBorder :"Active window border.",
activecaption :"Active window caption.",
appworkspace :"Background color of multiple document interface.",
background :"Desktop background.",
buttonface :"The face background color for 3-D elements that appear 3-D due to one layer of surrounding border.",
buttonhighlight :"The color of the border facing the light source for 3-D elements that appear 3-D due to one layer of surrounding border.",
buttonshadow :"The color of the border away from the light source for 3-D elements that appear 3-D due to one layer of surrounding border.",
buttontext :"Text on push buttons.",
captiontext :"Text in caption, size box, and scrollbar arrow box.",
graytext :"Grayed (disabled) text. This color is set to #000 if the current display driver does not support a solid gray color.",
highlight :"Item(s) selected in a control.",
highlighttext :"Text of item(s) selected in a control.",
inactiveborder :"Inactive window border.",
inactivecaption :"Inactive window caption.",
inactivecaptiontext :"Color of text in an inactive caption.",
infobackground :"Background color for tooltip controls.",
infotext :"Text color for tooltip controls.",
menu :"Menu background.",
menutext :"Text in menus.",
scrollbar :"Scroll bar gray area.",
threeddarkshadow :"The color of the darker (generally outer) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
threedface :"The face background color for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
threedhighlight :"The color of the lighter (generally outer) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
threedlightshadow :"The color of the darker (generally inner) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
threedshadow :"The color of the lighter (generally inner) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
window :"Window background.",
windowframe :"Window frame.",
windowtext :"Text in windows."
};
/*global SyntaxUnit, Parser*/
/**
Expand Down Expand Up @@ -1908,18 +1937,21 @@ Parser.prototype = function(){
});
},

_operator: function(){
_operator: function(inFunction){

/*
* operator
* operator (outside function)
* : '/' S* | ',' S* | /( empty )/
* operator (inside function)
* : '/' S* | '+' S* | '*' S* | '-' S* /( empty )/
* ;
*/

var tokenStream = this._tokenStream,
token = null;

if (tokenStream.match([Tokens.SLASH, Tokens.COMMA])){
if (tokenStream.match([Tokens.SLASH, Tokens.COMMA]) ||
(inFunction && tokenStream.match([Tokens.PLUS, Tokens.STAR, Tokens.MINUS]))){
token = tokenStream.token();
this._readWhitespace();
}
Expand Down Expand Up @@ -2706,7 +2738,7 @@ Parser.prototype = function(){
return result;
},

_expr: function(){
_expr: function(inFunction){
/*
* expr
* : term [ operator term ]*
Expand All @@ -2725,8 +2757,8 @@ Parser.prototype = function(){
values.push(value);

do {
operator = this._operator();
operator = this._operator(inFunction);

//if there's an operator, keep building up the value parts
if (operator){
values.push(operator);
Expand Down Expand Up @@ -2862,7 +2894,7 @@ Parser.prototype = function(){
if (tokenStream.match(Tokens.FUNCTION)){
functionText = tokenStream.token().value;
this._readWhitespace();
expr = this._expr();
expr = this._expr(true);
functionText += expr;

//START: Horrible hack in case it's an IE filter
Expand Down Expand Up @@ -6061,7 +6093,11 @@ var ValidationTypes = {
},

"<length>": function(part){
return part.type == "length" || part.type == "number" || part.type == "integer" || part == "0";
if (part.type == "function" && /^(?:\-(?:ms|moz|o|webkit)\-)?calc/i.test(part)){
return true;
}else{
return part.type == "length" || part.type == "number" || part.type == "integer" || part == "0";
}
},

"<color>": function(part){
Expand Down
2 changes: 1 addition & 1 deletion build/parserlib-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

*/
/* Version v@VERSION@, Build time: 16-November-2012 11:43:35 */
/* Version v@VERSION@, Build time: 19-November-2012 08:31:03 */
var parserlib = {};
(function(){

Expand Down
56 changes: 46 additions & 10 deletions build/parserlib-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

*/
/* Version v@VERSION@, Build time: 16-November-2012 11:43:35 */
/* Version v@VERSION@, Build time: 19-November-2012 08:31:03 */
(function(){
var EventTarget = parserlib.util.EventTarget,
TokenStreamBase = parserlib.util.TokenStreamBase,
Expand Down Expand Up @@ -170,7 +170,36 @@ var Colors = {
white :"#ffffff",
whitesmoke :"#f5f5f5",
yellow :"#ffff00",
yellowgreen :"#9acd32"
yellowgreen :"#9acd32",
//CSS2 system colors http://www.w3.org/TR/css3-color/#css2-system
activeBorder :"Active window border.",
activecaption :"Active window caption.",
appworkspace :"Background color of multiple document interface.",
background :"Desktop background.",
buttonface :"The face background color for 3-D elements that appear 3-D due to one layer of surrounding border.",
buttonhighlight :"The color of the border facing the light source for 3-D elements that appear 3-D due to one layer of surrounding border.",
buttonshadow :"The color of the border away from the light source for 3-D elements that appear 3-D due to one layer of surrounding border.",
buttontext :"Text on push buttons.",
captiontext :"Text in caption, size box, and scrollbar arrow box.",
graytext :"Grayed (disabled) text. This color is set to #000 if the current display driver does not support a solid gray color.",
highlight :"Item(s) selected in a control.",
highlighttext :"Text of item(s) selected in a control.",
inactiveborder :"Inactive window border.",
inactivecaption :"Inactive window caption.",
inactivecaptiontext :"Color of text in an inactive caption.",
infobackground :"Background color for tooltip controls.",
infotext :"Text color for tooltip controls.",
menu :"Menu background.",
menutext :"Text in menus.",
scrollbar :"Scroll bar gray area.",
threeddarkshadow :"The color of the darker (generally outer) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
threedface :"The face background color for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
threedhighlight :"The color of the lighter (generally outer) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
threedlightshadow :"The color of the darker (generally inner) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
threedshadow :"The color of the lighter (generally inner) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
window :"Window background.",
windowframe :"Window frame.",
windowtext :"Text in windows."
};
/*global SyntaxUnit, Parser*/
/**
Expand Down Expand Up @@ -998,18 +1027,21 @@ Parser.prototype = function(){
});
},

_operator: function(){
_operator: function(inFunction){

/*
* operator
* operator (outside function)
* : '/' S* | ',' S* | /( empty )/
* operator (inside function)
* : '/' S* | '+' S* | '*' S* | '-' S* /( empty )/
* ;
*/

var tokenStream = this._tokenStream,
token = null;

if (tokenStream.match([Tokens.SLASH, Tokens.COMMA])){
if (tokenStream.match([Tokens.SLASH, Tokens.COMMA]) ||
(inFunction && tokenStream.match([Tokens.PLUS, Tokens.STAR, Tokens.MINUS]))){
token = tokenStream.token();
this._readWhitespace();
}
Expand Down Expand Up @@ -1796,7 +1828,7 @@ Parser.prototype = function(){
return result;
},

_expr: function(){
_expr: function(inFunction){
/*
* expr
* : term [ operator term ]*
Expand All @@ -1815,8 +1847,8 @@ Parser.prototype = function(){
values.push(value);

do {
operator = this._operator();
operator = this._operator(inFunction);

//if there's an operator, keep building up the value parts
if (operator){
values.push(operator);
Expand Down Expand Up @@ -1952,7 +1984,7 @@ Parser.prototype = function(){
if (tokenStream.match(Tokens.FUNCTION)){
functionText = tokenStream.token().value;
this._readWhitespace();
expr = this._expr();
expr = this._expr(true);
functionText += expr;

//START: Horrible hack in case it's an IE filter
Expand Down Expand Up @@ -5151,7 +5183,11 @@ var ValidationTypes = {
},

"<length>": function(part){
return part.type == "length" || part.type == "number" || part.type == "integer" || part == "0";
if (part.type == "function" && /^(?:\-(?:ms|moz|o|webkit)\-)?calc/i.test(part)){
return true;
}else{
return part.type == "length" || part.type == "number" || part.type == "integer" || part == "0";
}
},

"<color>": function(part){
Expand Down
Loading