Skip to content

Commit e0be226

Browse files
Merrifield, Jayfracmak
authored andcommitted
added support for + operator for calc functions
1 parent 1845473 commit e0be226

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/css/Parser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,14 +712,14 @@ Parser.prototype = function(){
712712

713713
/*
714714
* operator
715-
* : '/' S* | ',' S* | '*' S* | '-' S* /( empty )/
715+
* : '/' S* | ',' S* | '+' S* | '*' S* | '-' S* /( empty )/
716716
* ;
717717
*/
718718

719719
var tokenStream = this._tokenStream,
720720
token = null;
721721

722-
if (tokenStream.match([Tokens.SLASH, Tokens.COMMA, Tokens.STAR, Tokens.MINUS])){
722+
if (tokenStream.match([Tokens.SLASH, Tokens.COMMA, Tokens.PLUS, Tokens.STAR, Tokens.MINUS])){
723723
token = tokenStream.token();
724724
this._readWhitespace();
725725
}

tests/css/Validation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@
493493
"1px",
494494
"1%",
495495
"calc(100% - 5px)",
496-
"calc(100% - 1em)",
496+
"calc(100% + 1em)",
497497
"calc(100%/6)",
498498
"calc(10%*6)",
499499
"inherit"

0 commit comments

Comments
 (0)