Permalink
Browse files

Release 0.1.7

  • Loading branch information...
nzakas committed May 4, 2012
1 parent e9a312a commit ebfaeb182e2c51a358cc09f0673ce4eca9add107
View
@@ -1,3 +1,15 @@
+May 4, 2012 - v0.1.7
+
+* Added text-rendering (Nicholas C. Zakas)
+* A little cleanup for validation with hacks (Nicholas C. Zakas)
+* Merge pull request #26 from moddular/webkit-gradient (Nicholas C. Zakas)
+* Updated <gradient> regex to allow -webkit-gradient (Andrew Walker)
+* Add 'behavior' as known property (fixes #25) (Nicholas C. Zakas)
+* Fix bug where star and underscore hacks interfered with validation (fixes #24) (Nicholas C. Zakas)
+* Merge pull request #22 from madr/patch-1 (Nicholas C. Zakas)
+* Update CHANGELOG: "-ms-" instead of "-moz-" (Anders Ytterström)
+
+
March 2, 2012 - v0.1.6
* Allow leading semicolon in front of properties (Nicholas C. Zakas)
@@ -221,3 +233,5 @@ November 28, 2011 - v0.1.0
+
+
View
@@ -1,7 +1,7 @@
<project name="parserlib" default="build.all">
<!-- version number -->
- <property name="parserlib.version" value="0.1.6" />
+ <property name="parserlib.version" value="0.1.7" />
<!-- the directories containing the source files -->
<property name="src.dir" value="./src" />
View
@@ -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: 4-May-2012 03:56:19 */
+/* Version v@VERSION@, Build time: 4-May-2012 03:57:04 */
var parserlib = {};
(function(){
@@ -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: 4-May-2012 03:56:19 */
+/* Version v@VERSION@, Build time: 4-May-2012 03:57:04 */
(function(){
var EventTarget = parserlib.util.EventTarget,
TokenStreamBase = parserlib.util.TokenStreamBase,
@@ -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: 4-May-2012 03:56:19 */
+/* Version v@VERSION@, Build time: 4-May-2012 03:57:04 */
var parserlib = {};
(function(){
@@ -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: 4-May-2012 03:56:19 */
+/* Version v@VERSION@, Build time: 4-May-2012 03:57:04 */
(function(){
var EventTarget = parserlib.util.EventTarget,
TokenStreamBase = parserlib.util.TokenStreamBase,
View
@@ -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: 4-May-2012 03:56:19 */
+/* Version v@VERSION@, Build time: 4-May-2012 03:57:04 */
var parserlib = {};
(function(){
View
@@ -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: 4-May-2012 03:56:19 */
+/* Version v@VERSION@, Build time: 4-May-2012 03:57:04 */
(function(){
var EventTarget = parserlib.util.EventTarget,
TokenStreamBase = parserlib.util.TokenStreamBase,
View
@@ -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: 4-May-2012 03:56:19 */
+/* Version v@VERSION@, Build time: 4-May-2012 03:57:04 */
var parserlib = {};
(function(){
@@ -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: 4-May-2012 03:56:19 */
+/* Version v@VERSION@, Build time: 4-May-2012 03:57:04 */
(function(){
var EventTarget = parserlib.util.EventTarget,
TokenStreamBase = parserlib.util.TokenStreamBase,
View
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-/* Version v0.1.6, Build time: 2-March-2012 02:44:32 */
+/* Version v0.1.7, Build time: 4-May-2012 03:57:04 */
var parserlib = {};
(function(){
@@ -931,7 +931,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-/* Version v0.1.6, Build time: 2-March-2012 02:44:32 */
+/* Version v0.1.7, Build time: 4-May-2012 03:57:04 */
(function(){
var EventTarget = parserlib.util.EventTarget,
TokenStreamBase = parserlib.util.TokenStreamBase,
@@ -2640,7 +2640,8 @@ Parser.prototype = function(){
expr = null,
prio = null,
error = null,
- invalid = null;
+ invalid = null,
+ propertyName= "";
property = this._property();
if (property !== null){
@@ -2657,8 +2658,20 @@ Parser.prototype = function(){
prio = this._prio();
+ /*
+ * If hacks should be allowed, then only check the root
+ * property. If hacks should not be allowed, treat
+ * _property or *property as invalid properties.
+ */
+ propertyName = property.toString();
+ if (this.options.starHack && property.hack == "*" ||
+ this.options.underscoreHack && property.hack == "_") {
+
+ propertyName = property.text;
+ }
+
try {
- this._validateProperty(property, expr);
+ this._validateProperty(propertyName, expr);
} catch (ex) {
invalid = ex;
}
@@ -3499,6 +3512,7 @@ var Properties = {
"background-repeat" : { multi: "<repeat-style>" },
"background-size" : { multi: "<bg-size>", comma: true },
"baseline-shift" : "baseline | sub | super | <percentage> | <length>",
+ "behavior" : 1,
"binding" : 1,
"bleed" : "<length>",
"bookmark-label" : "<content> | <attr> | <string>",
@@ -3845,6 +3859,7 @@ var Properties = {
"text-justify" : "auto | none | inter-word | inter-ideograph | inter-cluster | distribute | kashida",
"text-outline" : 1,
"text-overflow" : 1,
+ "text-rendering" : "auto | optimizeSpeed | optimizeLegibility | geometricPrecision | inherit",
"text-shadow" : 1,
"text-transform" : "capitalize | uppercase | lowercase | none | inherit",
"text-wrap" : "normal | none | avoid",
@@ -5924,7 +5939,7 @@ var ValidationTypes = {
i, len, found = false;
for (i=0,len=args.length; i < len && !found; i++){
- if (text == args[i]){
+ if (text == args[i].toLowerCase()){
found = true;
}
}
@@ -6016,7 +6031,7 @@ var ValidationTypes = {
},
"<gradient>": function(part) {
- return part.type == "function" && /^(?:\-(?:ms|moz|o|webkit)\-)?(?:repeating\-)?(?:radial|linear)\-gradient/i.test(part);
+ return part.type == "function" && /^(?:\-(?:ms|moz|o|webkit)\-)?(?:repeating\-)?(?:radial\-|linear\-)?gradient/i.test(part);
},
"<box>": function(part){
@@ -6108,6 +6123,18 @@ var ValidationTypes = {
part,
i, len;
+/*
+<position> = [
+ [ left | center | right | top | bottom | <percentage> | <length> ]
+|
+ [ left | center | right | <percentage> | <length> ]
+ [ top | center | bottom | <percentage> | <length> ]
+|
+ [ center | [ left | right ] [ <percentage> | <length> ]? ] &&
+ [ center | [ top | bottom ] [ <percentage> | <length> ]? ]
+]
+
+*/
if (ValidationTypes.isAny(expression, "top | bottom")) {
result = true;
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-/* Version v0.1.6, Build time: 2-March-2012 02:44:32 */
+/* Version v0.1.7, Build time: 4-May-2012 03:57:04 */
var parserlib = {};
(function(){
@@ -931,7 +931,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-/* Version v0.1.6, Build time: 2-March-2012 02:44:32 */
+/* Version v0.1.7, Build time: 4-May-2012 03:57:04 */
(function(){
var EventTarget = parserlib.util.EventTarget,
TokenStreamBase = parserlib.util.TokenStreamBase,
@@ -2640,7 +2640,8 @@ Parser.prototype = function(){
expr = null,
prio = null,
error = null,
- invalid = null;
+ invalid = null,
+ propertyName= "";
property = this._property();
if (property !== null){
@@ -2657,8 +2658,20 @@ Parser.prototype = function(){
prio = this._prio();
+ /*
+ * If hacks should be allowed, then only check the root
+ * property. If hacks should not be allowed, treat
+ * _property or *property as invalid properties.
+ */
+ propertyName = property.toString();
+ if (this.options.starHack && property.hack == "*" ||
+ this.options.underscoreHack && property.hack == "_") {
+
+ propertyName = property.text;
+ }
+
try {
- this._validateProperty(property, expr);
+ this._validateProperty(propertyName, expr);
} catch (ex) {
invalid = ex;
}
@@ -3499,6 +3512,7 @@ var Properties = {
"background-repeat" : { multi: "<repeat-style>" },
"background-size" : { multi: "<bg-size>", comma: true },
"baseline-shift" : "baseline | sub | super | <percentage> | <length>",
+ "behavior" : 1,
"binding" : 1,
"bleed" : "<length>",
"bookmark-label" : "<content> | <attr> | <string>",
@@ -3845,6 +3859,7 @@ var Properties = {
"text-justify" : "auto | none | inter-word | inter-ideograph | inter-cluster | distribute | kashida",
"text-outline" : 1,
"text-overflow" : 1,
+ "text-rendering" : "auto | optimizeSpeed | optimizeLegibility | geometricPrecision | inherit",
"text-shadow" : 1,
"text-transform" : "capitalize | uppercase | lowercase | none | inherit",
"text-wrap" : "normal | none | avoid",
@@ -5924,7 +5939,7 @@ var ValidationTypes = {
i, len, found = false;
for (i=0,len=args.length; i < len && !found; i++){
- if (text == args[i]){
+ if (text == args[i].toLowerCase()){
found = true;
}
}
@@ -6016,7 +6031,7 @@ var ValidationTypes = {
},
"<gradient>": function(part) {
- return part.type == "function" && /^(?:\-(?:ms|moz|o|webkit)\-)?(?:repeating\-)?(?:radial|linear)\-gradient/i.test(part);
+ return part.type == "function" && /^(?:\-(?:ms|moz|o|webkit)\-)?(?:repeating\-)?(?:radial\-|linear\-)?gradient/i.test(part);
},
"<box>": function(part){
@@ -6108,6 +6123,18 @@ var ValidationTypes = {
part,
i, len;
+/*
+<position> = [
+ [ left | center | right | top | bottom | <percentage> | <length> ]
+|
+ [ left | center | right | <percentage> | <length> ]
+ [ top | center | bottom | <percentage> | <length> ]
+|
+ [ center | [ left | right ] [ <percentage> | <length> ]? ] &&
+ [ center | [ top | bottom ] [ <percentage> | <length> ]? ]
+]
+
+*/
if (ValidationTypes.isAny(expression, "top | bottom")) {
result = true;
View
@@ -1,6 +1,6 @@
{
"name": "parserlib",
- "version": "0.1.6",
+ "version": "0.1.7",
"description": "CSSLint",
"author": "Nicholas C. Zakas",
"os": ["darwin", "linux"],
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-/* Version v0.1.6, Build time: 2-March-2012 02:44:32 */
+/* Version v0.1.7, Build time: 4-May-2012 03:57:04 */
var parserlib = {};
(function(){
Oops, something went wrong.

0 comments on commit ebfaeb1

Please sign in to comment.