Skip to content

Commit

Permalink
Release 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas committed Dec 4, 2012
1 parent a028647 commit 8cfc5a0
Show file tree
Hide file tree
Showing 14 changed files with 703 additions and 468 deletions.
39 changes: 39 additions & 0 deletions CHANGELOG
@@ -1,3 +1,40 @@
December 4, 2012 - v0.2.1

* Merge pull request #46 from nschonni/fix-vertical-align-missing-values (Nicholas C. Zakas)
* Add missing values from CSS3 vertical-align (Nick Schonning)
* Merge pull request #42 from nschonni/white-space-vendor-prefixes (Nicholas C. Zakas)
* Merge pull request #41 from nschonni/more-hack-tests (Nicholas C. Zakas)
* Add white-space vendor prefixed values (Nick Schonning)
* Add test for underscore hack (Nick Schonning)
* Merge pull request #40 from nschonni/fix-#38-CSS2-system-colors (Nicholas C. Zakas)
* Add CSS2 system colors (Nick Schonning)
* Merge branch 'master' of github.com:nzakas/parser-lib (Nicholas C. Zakas)
* Fix readme (Nicholas C. Zakas)
* Merge pull request #35 from fracmak/calc_support (Nicholas C. Zakas)
* Add travis build status to readme (Nicholas C. Zakas)
* Fixed media query tests (Nicholas C. Zakas)
* Merge pull request #30 from mirceapiturca/master (Nicholas C. Zakas)
* Merge pull request #37 from Unroll-Me/master (Nicholas C. Zakas)
* Remove platform restrictions (Schabse Laks)
* _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)
* added support for + operator for calc functions (Merrifield, Jay)
* added support for calc wherever <length> is expected (Merrifield, Jay)
* Fixed YUI Test issues, bumped version (Nicholas C. Zakas)
* Merge pull request #36 from mattiacci/border-radius (Nicholas C. Zakas)
* Fix validation of border-radius (Michael Mattiacci)
* Merge pull request #33 from mattiacci/bg-position (Nicholas C. Zakas)
* Fix validation of background-position (Michael Mattiacci)
* Update tests/css/Parser.js (mirceapiturca)
* Merge pull request #31 from nightwing/master (Nicholas C. Zakas)
* fix typo (nightwing)
* Update src/css/MediaQuery.js (mirceapiturca)
* Update build/node-parserlib.js (mirceapiturca)
* v0.1.9 (Nicholas C. Zakas)
* Expose vendor prefix for @keyframes (fixes #29) (Nicholas C. Zakas)
* Add support for o-keyframes and remove ms-keyframes (Nicholas C. Zakas)
* Fix changelog (Nicholas C. Zakas)


November 13, 2012 - v0.2.0

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








2 changes: 1 addition & 1 deletion build.xml
@@ -1,7 +1,7 @@
<project name="parserlib" default="build.all">

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

<!-- the directories containing the source files -->
<property name="src.dir" value="./src" />
Expand Down
4 changes: 2 additions & 2 deletions build/node-parserlib.js
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: 21-November-2012 04:23:31 */
/* Version v@VERSION@, Build time: 4-December-2012 11:58:48 */
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: 21-November-2012 04:23:31 */
/* Version v@VERSION@, Build time: 4-December-2012 11:58:48 */
(function(){
var EventTarget = parserlib.util.EventTarget,
TokenStreamBase = parserlib.util.TokenStreamBase,
Expand Down
4 changes: 2 additions & 2 deletions build/npm/lib/node-parserlib.js
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: 21-November-2012 04:23:31 */
/* Version v@VERSION@, Build time: 4-December-2012 11:58:48 */
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: 21-November-2012 04:23:31 */
/* Version v@VERSION@, Build time: 4-December-2012 11:58:48 */
(function(){
var EventTarget = parserlib.util.EventTarget,
TokenStreamBase = parserlib.util.TokenStreamBase,
Expand Down
2 changes: 1 addition & 1 deletion build/parserlib-core.js
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: 21-November-2012 04:23:31 */
/* Version v@VERSION@, Build time: 4-December-2012 11:58:48 */
var parserlib = {};
(function(){

Expand Down
2 changes: 1 addition & 1 deletion build/parserlib-css.js
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: 21-November-2012 04:23:31 */
/* Version v@VERSION@, Build time: 4-December-2012 11:58:48 */
(function(){
var EventTarget = parserlib.util.EventTarget,
TokenStreamBase = parserlib.util.TokenStreamBase,
Expand Down
4 changes: 2 additions & 2 deletions build/parserlib.js
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: 21-November-2012 04:23:31 */
/* Version v@VERSION@, Build time: 4-December-2012 11:58:48 */
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: 21-November-2012 04:23:31 */
/* Version v@VERSION@, Build time: 4-December-2012 11:58:48 */
(function(){
var EventTarget = parserlib.util.EventTarget,
TokenStreamBase = parserlib.util.TokenStreamBase,
Expand Down
64 changes: 50 additions & 14 deletions release/node-parserlib.js
Expand Up @@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/* Version v0.2.0, Build time: 13-November-2012 01:17:54 */
/* Version v0.2.1, Build time: 4-December-2012 11:58:48 */
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 v0.2.0, Build time: 13-November-2012 01:17:54 */
/* Version v0.2.1, Build time: 4-December-2012 11:58:48 */
(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 @@ -1169,7 +1198,7 @@ MediaFeature.prototype.constructor = MediaFeature;
*/
function MediaQuery(modifier, mediaType, features, line, col){

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

/**
* The media modifier ("not" or "only")
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 @@ -3888,7 +3920,7 @@ var Properties = {
"user-select" : "none | text | toggle | element | elements | all | inherit",

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

//W
"white-space" : "normal | pre | nowrap | pre-wrap | pre-line | inherit",
"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/
"white-space-collapse" : 1,
"widows" : "<integer> | inherit",
"width" : "<length> | <percentage> | auto | inherit" ,
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

0 comments on commit 8cfc5a0

Please sign in to comment.