diff options
Diffstat (limited to 'src/parse/properties.c')
-rw-r--r-- | src/parse/properties.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/parse/properties.c b/src/parse/properties.c index 7c81267..1c0c408 100644 --- a/src/parse/properties.c +++ b/src/parse/properties.c @@ -571,6 +571,18 @@ css_error parse_azimuth(css_language *c, if ((unit & UNIT_ANGLE) == false) return CSS_INVALID; + /* Valid angles lie between -360 and 360 degrees */ + if (unit == UNIT_DEG) { + if (length < FMULI(F_360, -1) || length > F_360) + return CSS_INVALID; + } else if (unit == UNIT_GRAD) { + if (length < FMULI(F_100, -1) || length > F_100) + return CSS_INVALID; + } else if (unit == UNIT_RAD) { + if (length < FMULI(F_2PI, -1) || length > F_2PI) + return CSS_INVALID; + } + value = AZIMUTH_ANGLE; } |