virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const { if (!value->isPrimitiveValue()) return; CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); short width; switch (primitiveValue->getIdent()) { case CSSValueThin: width = 1; break; case CSSValueMedium: width = 3; break; case CSSValueThick: width = 5; break; case CSSValueInvalid: width = primitiveValue->computeLengthShort(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom()); // CSS2 box model does not allow negative lengths for borders. if (width < 0) return; break; default: return; } (selector->style()->*m_setter)(width); }