diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-01-23 23:37:03 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-01-23 23:37:03 +0000 |
commit | fd2f9d71056f3647756f2bb81a40806e8cb6b52f (patch) | |
tree | bd3a68d088ac473126602e9c5489f46f18b5e99a /src/parse/properties.c | |
parent | c227f663b6285f9caa19df72baaeaa7d89cebfc7 (diff) | |
download | libcss-fd2f9d71056f3647756f2bb81a40806e8cb6b52f.tar.gz libcss-fd2f9d71056f3647756f2bb81a40806e8cb6b52f.tar.bz2 |
Range check elevation angle.
Add some more constants.
svn path=/trunk/libcss/; revision=6206
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 ff7460a..80958ac 100644 --- a/src/parse/properties.c +++ b/src/parse/properties.c @@ -2485,6 +2485,18 @@ css_error parse_elevation(css_language *c, if ((unit & UNIT_ANGLE) == false) return CSS_INVALID; + /* Valid angles lie between -90 and 90 degrees */ + if (unit == UNIT_DEG) { + if (length < FMULI(F_90, -1) || length > F_90) + 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_PI_2, -1) || length > F_PI_2) + return CSS_INVALID; + } + value = ELEVATION_ANGLE; } |