[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/khtml/css
From: Germain Garand <germain () ebooksfrance ! org>
Date: 2009-05-22 4:43:21
Message-ID: 1242967401.900895.28928.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 971234 by ggarand:
don't allow mix of percents and integers in functional-style colour
declarations since it is explicitely disallowed by CSS 2.1
BUG: 193434
M +5 -3 cssparser.cpp
--- trunk/KDE/kdelibs/khtml/css/cssparser.cpp #971233:971234
@@ -2259,18 +2259,20 @@
{
ValueList* args = value->function->args;
Value* v = args->current();
+
// Get the first value
if (!validUnit(v, FInteger | FPercent, true))
return false;
- colorArray[0] = static_cast<int>(v->fValue * (v->unit == \
CSSPrimitiveValue::CSS_PERCENTAGE ? 256.0 / 100.0 : 1.0)); + bool isPercent = \
(v->unit == CSSPrimitiveValue::CSS_PERCENTAGE); + colorArray[0] = \
static_cast<int>(v->fValue * (isPercent ? 256.0 / 100.0 : 1.0)); for (int i = 1; i < \
3; i++) { v = args->next();
if (v->unit != Value::Operator && v->iValue != ',')
return false;
v = args->next();
- if (!validUnit(v, FInteger | FPercent, true))
+ if (!validUnit(v, (isPercent ? FPercent : FInteger), true))
return false;
- colorArray[i] = static_cast<int>(v->fValue * (v->unit == \
CSSPrimitiveValue::CSS_PERCENTAGE ? 256.0 / 100.0 : 1.0)); + colorArray[i] = \
static_cast<int>(v->fValue * (isPercent ? 256.0 / 100.0 : 1.0)); }
if (parseAlpha) {
v = args->next();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic