Commit 6371ce25 authored by Andrea Iacovitti's avatar Andrea Iacovitti

Negative values are illegal for font-size property.

parent 2e492757
......@@ -914,7 +914,7 @@ bool CSSParser::parseValue( int propId, bool important )
if (id >= CSS_VAL_XX_SMALL && id <= CSS_VAL_LARGER)
valid_primitive = true;
else
valid_primitive = ( validUnit( value, FLength|FPercent, strict ) );
valid_primitive = validUnit(value, FLength|FPercent|FNonNeg, strict);
break;
case CSS_PROP_FONT_STYLE: // normal | italic | oblique | inherit
......@@ -2120,7 +2120,7 @@ bool CSSParser::parseFont( bool important )
// <absolute-size> | <relative-size> | <length> | <percentage> | inherit
if ( value->id >= CSS_VAL_XX_SMALL && value->id <= CSS_VAL_LARGER )
size = new CSSPrimitiveValueImpl( value->id );
else if ( validUnit( value, FLength|FPercent, strict ) ) {
else if (validUnit(value, FLength|FPercent|FNonNeg, strict)) {
size = new CSSPrimitiveValueImpl( value->fValue, (CSSPrimitiveValue::UnitTypes) value->unit );
}
if (!size) {
......
......@@ -3499,8 +3499,6 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
return;
}
if (size < 0) return;
// we never want to get smaller than the minimum font size to keep fonts readable
// do not however maximize zero as that is commonly used for fancy layouting purposes
if (size && size < minFontSize) size = minFontSize;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment