Skip to content

Commit 8cfc5a0

Browse files
committed
Release 0.2.1
1 parent a028647 commit 8cfc5a0

14 files changed

+703
-468
lines changed

CHANGELOG

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
December 4, 2012 - v0.2.1
2+
3+
* Merge pull request #46 from nschonni/fix-vertical-align-missing-values (Nicholas C. Zakas)
4+
* Add missing values from CSS3 vertical-align (Nick Schonning)
5+
* Merge pull request #42 from nschonni/white-space-vendor-prefixes (Nicholas C. Zakas)
6+
* Merge pull request #41 from nschonni/more-hack-tests (Nicholas C. Zakas)
7+
* Add white-space vendor prefixed values (Nick Schonning)
8+
* Add test for underscore hack (Nick Schonning)
9+
* Merge pull request #40 from nschonni/fix-#38-CSS2-system-colors (Nicholas C. Zakas)
10+
* Add CSS2 system colors (Nick Schonning)
11+
* Merge branch 'master' of github.com:nzakas/parser-lib (Nicholas C. Zakas)
12+
* Fix readme (Nicholas C. Zakas)
13+
* Merge pull request #35 from fracmak/calc_support (Nicholas C. Zakas)
14+
* Add travis build status to readme (Nicholas C. Zakas)
15+
* Fixed media query tests (Nicholas C. Zakas)
16+
* Merge pull request #30 from mirceapiturca/master (Nicholas C. Zakas)
17+
* Merge pull request #37 from Unroll-Me/master (Nicholas C. Zakas)
18+
* Remove platform restrictions (Schabse Laks)
19+
* _operator is used for seperating multiple values for a property (ie. box-shadow: 10px 10px 0, 2px 2px 0) as well as for mathematical operators inside functions. Since functions are the only place mathematical operators are allowed, we now pass in a boolean to distinguish which token is acceptable to not accidentally treat -10px -10px as an equation (Jay Merrifield)
20+
* added support for + operator for calc functions (Merrifield, Jay)
21+
* added support for calc wherever <length> is expected (Merrifield, Jay)
22+
* Fixed YUI Test issues, bumped version (Nicholas C. Zakas)
23+
* Merge pull request #36 from mattiacci/border-radius (Nicholas C. Zakas)
24+
* Fix validation of border-radius (Michael Mattiacci)
25+
* Merge pull request #33 from mattiacci/bg-position (Nicholas C. Zakas)
26+
* Fix validation of background-position (Michael Mattiacci)
27+
* Update tests/css/Parser.js (mirceapiturca)
28+
* Merge pull request #31 from nightwing/master (Nicholas C. Zakas)
29+
* fix typo (nightwing)
30+
* Update src/css/MediaQuery.js (mirceapiturca)
31+
* Update build/node-parserlib.js (mirceapiturca)
32+
* v0.1.9 (Nicholas C. Zakas)
33+
* Expose vendor prefix for @keyframes (fixes #29) (Nicholas C. Zakas)
34+
* Add support for o-keyframes and remove ms-keyframes (Nicholas C. Zakas)
35+
* Fix changelog (Nicholas C. Zakas)
36+
37+
138
November 13, 2012 - v0.2.0
239

340
* Merge pull request #36 from mattiacci/border-radius (Nicholas C. Zakas)
@@ -266,6 +303,8 @@ November 28, 2011 - v0.1.0
266303

267304

268305

306+
307+
269308

270309

271310

build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<project name="parserlib" default="build.all">
22

33
<!-- version number -->
4-
<property name="parserlib.version" value="0.2.0" />
4+
<property name="parserlib.version" value="0.2.1" />
55

66
<!-- the directories containing the source files -->
77
<property name="src.dir" value="./src" />

build/node-parserlib.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
THE SOFTWARE.
2222
2323
*/
24-
/* Version v@VERSION@, Build time: 21-November-2012 04:23:31 */
24+
/* Version v@VERSION@, Build time: 4-December-2012 11:58:48 */
2525
var parserlib = {};
2626
(function(){
2727

@@ -931,7 +931,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
931931
THE SOFTWARE.
932932
933933
*/
934-
/* Version v@VERSION@, Build time: 21-November-2012 04:23:31 */
934+
/* Version v@VERSION@, Build time: 4-December-2012 11:58:48 */
935935
(function(){
936936
var EventTarget = parserlib.util.EventTarget,
937937
TokenStreamBase = parserlib.util.TokenStreamBase,

build/npm/lib/node-parserlib.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
THE SOFTWARE.
2222
2323
*/
24-
/* Version v@VERSION@, Build time: 21-November-2012 04:23:31 */
24+
/* Version v@VERSION@, Build time: 4-December-2012 11:58:48 */
2525
var parserlib = {};
2626
(function(){
2727

@@ -931,7 +931,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
931931
THE SOFTWARE.
932932
933933
*/
934-
/* Version v@VERSION@, Build time: 21-November-2012 04:23:31 */
934+
/* Version v@VERSION@, Build time: 4-December-2012 11:58:48 */
935935
(function(){
936936
var EventTarget = parserlib.util.EventTarget,
937937
TokenStreamBase = parserlib.util.TokenStreamBase,

build/parserlib-core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
THE SOFTWARE.
2222
2323
*/
24-
/* Version v@VERSION@, Build time: 21-November-2012 04:23:31 */
24+
/* Version v@VERSION@, Build time: 4-December-2012 11:58:48 */
2525
var parserlib = {};
2626
(function(){
2727

build/parserlib-css.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
THE SOFTWARE.
2222
2323
*/
24-
/* Version v@VERSION@, Build time: 21-November-2012 04:23:31 */
24+
/* Version v@VERSION@, Build time: 4-December-2012 11:58:48 */
2525
(function(){
2626
var EventTarget = parserlib.util.EventTarget,
2727
TokenStreamBase = parserlib.util.TokenStreamBase,

build/parserlib.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
THE SOFTWARE.
2222
2323
*/
24-
/* Version v@VERSION@, Build time: 21-November-2012 04:23:31 */
24+
/* Version v@VERSION@, Build time: 4-December-2012 11:58:48 */
2525
var parserlib = {};
2626
(function(){
2727

@@ -931,7 +931,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
931931
THE SOFTWARE.
932932
933933
*/
934-
/* Version v@VERSION@, Build time: 21-November-2012 04:23:31 */
934+
/* Version v@VERSION@, Build time: 4-December-2012 11:58:48 */
935935
(function(){
936936
var EventTarget = parserlib.util.EventTarget,
937937
TokenStreamBase = parserlib.util.TokenStreamBase,

release/node-parserlib.js

Lines changed: 50 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
THE SOFTWARE.
2222
2323
*/
24-
/* Version v0.2.0, Build time: 13-November-2012 01:17:54 */
24+
/* Version v0.2.1, Build time: 4-December-2012 11:58:48 */
2525
var parserlib = {};
2626
(function(){
2727

@@ -931,7 +931,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
931931
THE SOFTWARE.
932932
933933
*/
934-
/* Version v0.2.0, Build time: 13-November-2012 01:17:54 */
934+
/* Version v0.2.1, Build time: 4-December-2012 11:58:48 */
935935
(function(){
936936
var EventTarget = parserlib.util.EventTarget,
937937
TokenStreamBase = parserlib.util.TokenStreamBase,
@@ -1080,7 +1080,36 @@ var Colors = {
10801080
white :"#ffffff",
10811081
whitesmoke :"#f5f5f5",
10821082
yellow :"#ffff00",
1083-
yellowgreen :"#9acd32"
1083+
yellowgreen :"#9acd32",
1084+
//CSS2 system colors http://www.w3.org/TR/css3-color/#css2-system
1085+
activeBorder :"Active window border.",
1086+
activecaption :"Active window caption.",
1087+
appworkspace :"Background color of multiple document interface.",
1088+
background :"Desktop background.",
1089+
buttonface :"The face background color for 3-D elements that appear 3-D due to one layer of surrounding border.",
1090+
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.",
1091+
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.",
1092+
buttontext :"Text on push buttons.",
1093+
captiontext :"Text in caption, size box, and scrollbar arrow box.",
1094+
graytext :"Grayed (disabled) text. This color is set to #000 if the current display driver does not support a solid gray color.",
1095+
highlight :"Item(s) selected in a control.",
1096+
highlighttext :"Text of item(s) selected in a control.",
1097+
inactiveborder :"Inactive window border.",
1098+
inactivecaption :"Inactive window caption.",
1099+
inactivecaptiontext :"Color of text in an inactive caption.",
1100+
infobackground :"Background color for tooltip controls.",
1101+
infotext :"Text color for tooltip controls.",
1102+
menu :"Menu background.",
1103+
menutext :"Text in menus.",
1104+
scrollbar :"Scroll bar gray area.",
1105+
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.",
1106+
threedface :"The face background color for 3-D elements that appear 3-D due to two concentric layers of surrounding border.",
1107+
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.",
1108+
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.",
1109+
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.",
1110+
window :"Window background.",
1111+
windowframe :"Window frame.",
1112+
windowtext :"Text in windows."
10841113
};
10851114
/*global SyntaxUnit, Parser*/
10861115
/**
@@ -1169,7 +1198,7 @@ MediaFeature.prototype.constructor = MediaFeature;
11691198
*/
11701199
function MediaQuery(modifier, mediaType, features, line, col){
11711200

1172-
SyntaxUnit.call(this, (modifier ? modifier + " ": "") + (mediaType ? mediaType + " " : "") + features.join(" and "), line, col, Parser.MEDIA_QUERY_TYPE);
1201+
SyntaxUnit.call(this, (modifier ? modifier + " ": "") + (mediaType ? mediaType : "") + (mediaType && features.length > 0 ? " and " : "") + features.join(" and "), line, col, Parser.MEDIA_QUERY_TYPE);
11731202

11741203
/**
11751204
* The media modifier ("not" or "only")
@@ -1908,18 +1937,21 @@ Parser.prototype = function(){
19081937
});
19091938
},
19101939

1911-
_operator: function(){
1940+
_operator: function(inFunction){
19121941

19131942
/*
1914-
* operator
1943+
* operator (outside function)
19151944
* : '/' S* | ',' S* | /( empty )/
1945+
* operator (inside function)
1946+
* : '/' S* | '+' S* | '*' S* | '-' S* /( empty )/
19161947
* ;
19171948
*/
19181949

19191950
var tokenStream = this._tokenStream,
19201951
token = null;
19211952

1922-
if (tokenStream.match([Tokens.SLASH, Tokens.COMMA])){
1953+
if (tokenStream.match([Tokens.SLASH, Tokens.COMMA]) ||
1954+
(inFunction && tokenStream.match([Tokens.PLUS, Tokens.STAR, Tokens.MINUS]))){
19231955
token = tokenStream.token();
19241956
this._readWhitespace();
19251957
}
@@ -2706,7 +2738,7 @@ Parser.prototype = function(){
27062738
return result;
27072739
},
27082740

2709-
_expr: function(){
2741+
_expr: function(inFunction){
27102742
/*
27112743
* expr
27122744
* : term [ operator term ]*
@@ -2725,8 +2757,8 @@ Parser.prototype = function(){
27252757
values.push(value);
27262758

27272759
do {
2728-
operator = this._operator();
2729-
2760+
operator = this._operator(inFunction);
2761+
27302762
//if there's an operator, keep building up the value parts
27312763
if (operator){
27322764
values.push(operator);
@@ -2862,7 +2894,7 @@ Parser.prototype = function(){
28622894
if (tokenStream.match(Tokens.FUNCTION)){
28632895
functionText = tokenStream.token().value;
28642896
this._readWhitespace();
2865-
expr = this._expr();
2897+
expr = this._expr(true);
28662898
functionText += expr;
28672899

28682900
//START: Horrible hack in case it's an IE filter
@@ -3888,7 +3920,7 @@ var Properties = {
38883920
"user-select" : "none | text | toggle | element | elements | all | inherit",
38893921

38903922
//V
3891-
"vertical-align" : "<percentage> | <length> | baseline | sub | super | top | text-top | middle | bottom | text-bottom | inherit",
3923+
"vertical-align" : "auto | use-script | baseline | sub | super | top | text-top | central | middle | bottom | text-bottom | <percentage> | <length>",
38923924
"visibility" : "visible | hidden | collapse | inherit",
38933925
"voice-balance" : 1,
38943926
"voice-duration" : 1,
@@ -3901,7 +3933,7 @@ var Properties = {
39013933
"volume" : 1,
39023934

39033935
//W
3904-
"white-space" : "normal | pre | nowrap | pre-wrap | pre-line | inherit",
3936+
"white-space" : "normal | pre | nowrap | pre-wrap | pre-line | inherit | -pre-wrap | -o-pre-wrap | -moz-pre-wrap | -hp-pre-wrap", //http://perishablepress.com/wrapping-content/
39053937
"white-space-collapse" : 1,
39063938
"widows" : "<integer> | inherit",
39073939
"width" : "<length> | <percentage> | auto | inherit" ,
@@ -6061,7 +6093,11 @@ var ValidationTypes = {
60616093
},
60626094

60636095
"<length>": function(part){
6064-
return part.type == "length" || part.type == "number" || part.type == "integer" || part == "0";
6096+
if (part.type == "function" && /^(?:\-(?:ms|moz|o|webkit)\-)?calc/i.test(part)){
6097+
return true;
6098+
}else{
6099+
return part.type == "length" || part.type == "number" || part.type == "integer" || part == "0";
6100+
}
60656101
},
60666102

60676103
"<color>": function(part){

0 commit comments

Comments
 (0)