Invalid three value positions are no longer accepted

This commit is contained in:
shubDhond 2017-02-23 00:21:19 -05:00
parent 082fbe9e15
commit ddc189c820
3 changed files with 8 additions and 6 deletions

View file

@ -187,13 +187,11 @@ impl Parse for Position {
} else {
// Handle 3 value background position there are several options:
if let PositionCategory::LengthOrPercentage = category(&first) {
// "length keyword length"
Position::new(Some(first), Some(third), None, Some(second))
Err(())
} else {
if let PositionCategory::LengthOrPercentage = category(&second) {
if let PositionCategory::LengthOrPercentage = category(&third) {
// "keyword length length"
Position::new(Some(second), Some(third), Some(first), None)
Err(())
} else {
// "keyword length keyword"
Position::new(Some(second), None, Some(first), Some(third))