summaryrefslogtreecommitdiff
path: root/src/parse/properties.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-01-23 19:29:03 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-01-23 19:29:03 +0000
commitcc5c3f01c6958685130a9a037abaa4dd3df86b20 (patch)
treeada1f1aa398d95d87faa84aa4fd0f0c342a91492 /src/parse/properties.c
parentddc5e14034a837142ee7a49059e3715ad30ab9d2 (diff)
downloadlibcss-cc5c3f01c6958685130a9a037abaa4dd3df86b20.tar.gz
libcss-cc5c3f01c6958685130a9a037abaa4dd3df86b20.tar.bz2
Introduce fixed point constants.
Range check azimuth angles. svn path=/trunk/libcss/; revision=6183
Diffstat (limited to 'src/parse/properties.c')
-rw-r--r--src/parse/properties.c12
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;
}