css
2326 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextRenderingMode e) 2327 : m_type(CSS_IDENT) 2328 , m_hasCachedCSSText(false) 2329 { 2330 switch (e) { 2331 case AutoTextRendering: 2332 m_value.ident = CSSValueAuto; 2333 break; 2334 case OptimizeSpeed: 2335 m_value.ident = CSSValueOptimizespeed; 2336 break; 2337 case OptimizeLegibility: 2338 m_value.ident = CSSValueOptimizelegibility; 2339 break; 2340 case GeometricPrecision: 2341 m_value.ident = CSSValueGeometricprecision; 2342 break; 2343 } 2344 }
755 bool CSSParser::parseValue(int propId, bool important) 756 { 757 if (!m_valueList) 758 return false; 759 760 CSSParserValue* value = m_valueList->current(); 761 762 if (!value) 763 return false; 764 765 int id = value->id; 766 767 // In quirks mode, we will look for units that have been incorrectly separated from the number they belong to 768 // by a space. We go ahead and associate the unit with the number even though it is invalid CSS. 769 checkForOrphanedUnits(); 770 771 int num = inShorthand() ? 1 : m_valueList->size(); 772 773 if (id == CSSValueInherit) { 774 if (num != 1) 775 return false; 776 addProperty(propId, CSSInheritedValue::create(), important); 777 return true; 778 } 779 else if (id == CSSValueInitial) { 780 if (num != 1) 781 return false; 782 addProperty(propId, CSSInitialValue::createExplicit(), important); 783 return true; 784 } 785 786 bool validPrimitive = false; 787 RefPtr<CSSValue> parsedValue; 788 789 switch (static_cast<CSSPropertyID>(propId)) { 1670 case CSSPropertyTextRendering: // auto | optimizeSpeed | optimizeLegibility | geometricPrecision 1671 if (id == CSSValueAuto || id == CSSValueOptimizespeed || id == CSSValueOptimizelegibility 1672 || id == CSSValueGeometricprecision) 1673 validPrimitive = true; 1674 break;