Skip to content
Closed
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
2 changes: 1 addition & 1 deletion src/css/Properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var Properties = {
"-o-animation-name" : { multi: "none | <ident>", comma: true },
"-o-animation-play-state" : { multi: "running | paused", comma: true },

"appearance" : "icon | window | desktop | workspace | document | tooltip | dialog | button | push-button | hyperlink | radio-button | checkbox | menu-item | tab | menu | menubar | pull-down-menu | pop-up-menu | list-menu | radio-group | checkbox-group | outline-tree | range | field | combo-box | signature | password | normal | none | inherit",
"appearance" : "icon | window | desktop | workspace | document | tooltip | dialog | button | push-button | hyperlink | radio | radio-button | checkbox | menu-item | tab | menu | menubar | pull-down-menu | pop-up-menu | list-menu | radio-group | checkbox-group | outline-tree | range | field | combo-box | signature | password | normal | none | inherit",
"azimuth" : function (expression) {
var simple = "<angle> | leftwards | rightwards | inherit",
direction = "left-side | far-left | left | center-left | center | center-right | right | far-right | right-side",
Expand Down
2 changes: 1 addition & 1 deletion src/css/ValidationTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ var ValidationTypes = {
},

"<padding-width>": function(part){
return this["<length>"](part) || this["<percentage>"](part);
return part.value >= 0 && (this["<length>"](part) || this["<percentage>"](part));
},

"<shape>": function(part){
Expand Down
44 changes: 44 additions & 0 deletions tests/css/CSSParserTests.htm
Original file line number Diff line number Diff line change
Expand Up @@ -1797,6 +1797,50 @@ <h1>CSS Parser Tests</h1>

},

testPaddingLeft1: function(){
var parser = new Parser({ strict: true});
parser.addListener("property", function(event){
assert.isNull(event.invalid);
});
var result = parser.parse(".foo { padding-left: 6px; }");

},

testPaddingLeft2: function(){
var parser = new Parser({ strict: true});
parser.addListener("property", function(event){
assert.isNull(event.invalid);
});
var result = parser.parse(".foo { padding-left: 3%; }");
},

testPaddingLeft3: function(){
var parser = new Parser({ strict: true});
parser.addListener("property", function(event){
assert.isNull(event.invalid);
});
var result = parser.parse(".foo { padding-left: inherit; }");

},

testInvalidPaddingLeft1: function(){
var parser = new Parser({ strict: true});
parser.addListener("property", function(event){
assert.isNotNull(event.invalid);
assert.areEqual("Expected length greater than 0, percentage greater than 0 or inherit but found '-10px'.", event.invalid.message);
});
var result = parser.parse(".foo { padding-left: -10px; }");
},

testInvalidPaddingLeft2: function(){
var parser = new Parser({ strict: true});
parser.addListener("property", function(event){
assert.isNotNull(event.invalid);
assert.areEqual("Expected length, percentage or inherit but found 'auto'.", event.invalid.message);
});
var result = parser.parse(".foo { padding-left: auto; }");
},

testBorderWidth1: function(){
var parser = new Parser({ strict: true});
parser.addListener("property", function(event){
Expand Down
15 changes: 15 additions & 0 deletions tests/css/Validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,21 @@
}
}));

suite.add(new ValidationTestCase({
property: "padding-left",

valid: [
"6px",
"3%",
"inherit"
],

invalid: {
"-10px" : "Expected (<padding-width> | inherit) but found '-10px'.",
"auto" : "Expected (<padding-width> | inherit) but found 'auto'."
}
}));

suite.add(new ValidationTestCase({
property: "will-change",

Expand Down