| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * * Redistributions of source code must retain the above copyright | 4 * * Redistributions of source code must retain the above copyright |
| 5 * notice, this list of conditions and the following disclaimer. | 5 * notice, this list of conditions and the following disclaimer. |
| 6 * * Redistributions in binary form must reproduce the above | 6 * * Redistributions in binary form must reproduce the above |
| 7 * copyright notice, this list of conditions and the following disclaimer | 7 * copyright notice, this list of conditions and the following disclaimer |
| 8 * in the documentation and/or other materials provided with the | 8 * in the documentation and/or other materials provided with the |
| 9 * distribution. | 9 * distribution. |
| 10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 83 } |
| 84 | 84 |
| 85 AtomicString StyleBuilderConverter::convertFragmentIdentifier(StyleResolverState
& state, CSSValue* value) | 85 AtomicString StyleBuilderConverter::convertFragmentIdentifier(StyleResolverState
& state, CSSValue* value) |
| 86 { | 86 { |
| 87 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 87 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
| 88 if (primitiveValue->isURI()) | 88 if (primitiveValue->isURI()) |
| 89 return SVGURIReference::fragmentIdentifierFromIRIString(primitiveValue->
getStringValue(), state.element()->treeScope()); | 89 return SVGURIReference::fragmentIdentifierFromIRIString(primitiveValue->
getStringValue(), state.element()->treeScope()); |
| 90 return nullAtom; | 90 return nullAtom; |
| 91 } | 91 } |
| 92 | 92 |
| 93 FontDescription::VariantLigatures StyleBuilderConverter::convertFontVariantLigat
ures(StyleResolverState&, CSSValue* value) |
| 94 { |
| 95 if (value->isValueList()) { |
| 96 FontDescription::VariantLigatures ligatures; |
| 97 CSSValueList* valueList = toCSSValueList(value); |
| 98 for (size_t i = 0; i < valueList->length(); ++i) { |
| 99 CSSValue* item = valueList->item(i); |
| 100 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item); |
| 101 switch (primitiveValue->getValueID()) { |
| 102 case CSSValueNoCommonLigatures: |
| 103 ligatures.common = FontDescription::DisabledLigaturesState; |
| 104 break; |
| 105 case CSSValueCommonLigatures: |
| 106 ligatures.common = FontDescription::EnabledLigaturesState; |
| 107 break; |
| 108 case CSSValueNoDiscretionaryLigatures: |
| 109 ligatures.discretionary = FontDescription::DisabledLigaturesStat
e; |
| 110 break; |
| 111 case CSSValueDiscretionaryLigatures: |
| 112 ligatures.discretionary = FontDescription::EnabledLigaturesState
; |
| 113 break; |
| 114 case CSSValueNoHistoricalLigatures: |
| 115 ligatures.historical = FontDescription::DisabledLigaturesState; |
| 116 break; |
| 117 case CSSValueHistoricalLigatures: |
| 118 ligatures.historical = FontDescription::EnabledLigaturesState; |
| 119 break; |
| 120 case CSSValueNoContextual: |
| 121 ligatures.contextual = FontDescription::DisabledLigaturesState; |
| 122 break; |
| 123 case CSSValueContextual: |
| 124 ligatures.contextual = FontDescription::EnabledLigaturesState; |
| 125 break; |
| 126 default: |
| 127 ASSERT_NOT_REACHED(); |
| 128 break; |
| 129 } |
| 130 } |
| 131 return ligatures; |
| 132 } |
| 133 |
| 134 ASSERT_WITH_SECURITY_IMPLICATION(value->isPrimitiveValue()); |
| 135 ASSERT(toCSSPrimitiveValue(value)->getValueID() == CSSValueNormal); |
| 136 return FontDescription::VariantLigatures(); |
| 137 } |
| 138 |
| 93 EGlyphOrientation StyleBuilderConverter::convertGlyphOrientation(StyleResolverSt
ate&, CSSValue* value) | 139 EGlyphOrientation StyleBuilderConverter::convertGlyphOrientation(StyleResolverSt
ate&, CSSValue* value) |
| 94 { | 140 { |
| 95 if (!value->isPrimitiveValue()) | 141 if (!value->isPrimitiveValue()) |
| 96 return GO_0DEG; | 142 return GO_0DEG; |
| 97 | 143 |
| 98 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 144 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
| 99 if (primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_DEG) | 145 if (primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_DEG) |
| 100 return GO_0DEG; | 146 return GO_0DEG; |
| 101 | 147 |
| 102 float angle = fabsf(fmodf(primitiveValue->getFloatValue(), 360.0f)); | 148 float angle = fabsf(fmodf(primitiveValue->getFloatValue(), 360.0f)); |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 { | 496 { |
| 451 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 497 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
| 452 if (primitiveValue->getValueID()) { | 498 if (primitiveValue->getValueID()) { |
| 453 float multiplier = convertLineWidth<float>(state, value); | 499 float multiplier = convertLineWidth<float>(state, value); |
| 454 return CSSPrimitiveValue::create(multiplier / 48, CSSPrimitiveValue::CSS
_EMS)->computeLength<float>(state.cssToLengthConversionData()); | 500 return CSSPrimitiveValue::create(multiplier / 48, CSSPrimitiveValue::CSS
_EMS)->computeLength<float>(state.cssToLengthConversionData()); |
| 455 } | 501 } |
| 456 return primitiveValue->computeLength<float>(state.cssToLengthConversionData(
)); | 502 return primitiveValue->computeLength<float>(state.cssToLengthConversionData(
)); |
| 457 } | 503 } |
| 458 | 504 |
| 459 } // namespace blink | 505 } // namespace blink |
| OLD | NEW |