| 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 13 matching lines...) Expand all Loading... |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #ifndef SKY_ENGINE_CORE_CSS_RESOLVER_STYLEBUILDERCONVERTER_H_ | 27 #ifndef SKY_ENGINE_CORE_CSS_RESOLVER_STYLEBUILDERCONVERTER_H_ |
| 28 #define SKY_ENGINE_CORE_CSS_RESOLVER_STYLEBUILDERCONVERTER_H_ | 28 #define SKY_ENGINE_CORE_CSS_RESOLVER_STYLEBUILDERCONVERTER_H_ |
| 29 | 29 |
| 30 #include "sky/engine/core/css/CSSValue.h" | 30 #include "sky/engine/core/css/CSSValue.h" |
| 31 #include "sky/engine/core/css/CSSValueList.h" | 31 #include "sky/engine/core/css/CSSValueList.h" |
| 32 #include "sky/engine/core/css/resolver/StyleResolverState.h" | 32 #include "sky/engine/core/css/resolver/StyleResolverState.h" |
| 33 #include "sky/engine/core/rendering/RenderView.h" | 33 #include "sky/engine/core/rendering/RenderView.h" |
| 34 #include "sky/engine/core/rendering/style/QuotesData.h" | |
| 35 #include "sky/engine/core/rendering/style/ShadowList.h" | 34 #include "sky/engine/core/rendering/style/ShadowList.h" |
| 36 #include "sky/engine/platform/LengthSize.h" | 35 #include "sky/engine/platform/LengthSize.h" |
| 37 #include "sky/engine/platform/fonts/FontDescription.h" | 36 #include "sky/engine/platform/fonts/FontDescription.h" |
| 38 | 37 |
| 39 namespace blink { | 38 namespace blink { |
| 40 | 39 |
| 41 // Note that we assume the parser only allows valid CSSValue types. | 40 // Note that we assume the parser only allows valid CSSValue types. |
| 42 | 41 |
| 43 class StyleBuilderConverter { | 42 class StyleBuilderConverter { |
| 44 public: | 43 public: |
| 45 static AtomicString convertFragmentIdentifier(StyleResolverState&, CSSValue*
); | 44 static AtomicString convertFragmentIdentifier(StyleResolverState&, CSSValue*
); |
| 46 static Color convertColor(StyleResolverState&, CSSValue*); | 45 static Color convertColor(StyleResolverState&, CSSValue*); |
| 47 template <typename T> static T convertComputedLength(StyleResolverState&, CS
SValue*); | 46 template <typename T> static T convertComputedLength(StyleResolverState&, CS
SValue*); |
| 48 static LengthBox convertClip(StyleResolverState&, CSSValue*); | 47 static LengthBox convertClip(StyleResolverState&, CSSValue*); |
| 49 template <typename T> static T convertFlags(StyleResolverState&, CSSValue*); | 48 template <typename T> static T convertFlags(StyleResolverState&, CSSValue*); |
| 50 static PassRefPtr<FontFeatureSettings> convertFontFeatureSettings(StyleResol
verState&, CSSValue*); | 49 static PassRefPtr<FontFeatureSettings> convertFontFeatureSettings(StyleResol
verState&, CSSValue*); |
| 51 static FontWeight convertFontWeight(StyleResolverState&, CSSValue*); | 50 static FontWeight convertFontWeight(StyleResolverState&, CSSValue*); |
| 52 static FontDescription::VariantLigatures convertFontVariantLigatures(StyleRe
solverState&, CSSValue*); | 51 static FontDescription::VariantLigatures convertFontVariantLigatures(StyleRe
solverState&, CSSValue*); |
| 53 template <typename T> static T convertLineWidth(StyleResolverState&, CSSValu
e*); | 52 template <typename T> static T convertLineWidth(StyleResolverState&, CSSValu
e*); |
| 54 static Length convertLength(StyleResolverState&, CSSValue*); | 53 static Length convertLength(StyleResolverState&, CSSValue*); |
| 55 static Length convertLengthOrAuto(StyleResolverState&, CSSValue*); | 54 static Length convertLengthOrAuto(StyleResolverState&, CSSValue*); |
| 56 static Length convertLengthSizing(StyleResolverState&, CSSValue*); | 55 static Length convertLengthSizing(StyleResolverState&, CSSValue*); |
| 57 static Length convertLengthMaxSizing(StyleResolverState&, CSSValue*); | 56 static Length convertLengthMaxSizing(StyleResolverState&, CSSValue*); |
| 58 static LengthPoint convertLengthPoint(StyleResolverState&, CSSValue*); | 57 static LengthPoint convertLengthPoint(StyleResolverState&, CSSValue*); |
| 59 static LineBoxContain convertLineBoxContain(StyleResolverState&, CSSValue*); | 58 static LineBoxContain convertLineBoxContain(StyleResolverState&, CSSValue*); |
| 60 static float convertNumberOrPercentage(StyleResolverState&, CSSValue*); | 59 static float convertNumberOrPercentage(StyleResolverState&, CSSValue*); |
| 61 static PassRefPtr<QuotesData> convertQuotes(StyleResolverState&, CSSValue*); | |
| 62 static LengthSize convertRadius(StyleResolverState&, CSSValue*); | 60 static LengthSize convertRadius(StyleResolverState&, CSSValue*); |
| 63 static PassRefPtr<ShadowList> convertShadow(StyleResolverState&, CSSValue*); | 61 static PassRefPtr<ShadowList> convertShadow(StyleResolverState&, CSSValue*); |
| 64 static float convertSpacing(StyleResolverState&, CSSValue*); | 62 static float convertSpacing(StyleResolverState&, CSSValue*); |
| 65 template <CSSValueID IdForNone> static AtomicString convertString(StyleResol
verState&, CSSValue*); | 63 template <CSSValueID IdForNone> static AtomicString convertString(StyleResol
verState&, CSSValue*); |
| 66 static float convertTextStrokeWidth(StyleResolverState&, CSSValue*); | 64 static float convertTextStrokeWidth(StyleResolverState&, CSSValue*); |
| 67 }; | 65 }; |
| 68 | 66 |
| 69 template <typename T> | 67 template <typename T> |
| 70 T StyleBuilderConverter::convertComputedLength(StyleResolverState& state, CSSVal
ue* value) | 68 T StyleBuilderConverter::convertComputedLength(StyleResolverState& state, CSSVal
ue* value) |
| 71 { | 69 { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 { | 104 { |
| 107 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 105 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
| 108 if (primitiveValue->getValueID() == IdForNone) | 106 if (primitiveValue->getValueID() == IdForNone) |
| 109 return nullAtom; | 107 return nullAtom; |
| 110 return AtomicString(primitiveValue->getStringValue()); | 108 return AtomicString(primitiveValue->getStringValue()); |
| 111 } | 109 } |
| 112 | 110 |
| 113 } // namespace blink | 111 } // namespace blink |
| 114 | 112 |
| 115 #endif // SKY_ENGINE_CORE_CSS_RESOLVER_STYLEBUILDERCONVERTER_H_ | 113 #endif // SKY_ENGINE_CORE_CSS_RESOLVER_STYLEBUILDERCONVERTER_H_ |
| OLD | NEW |