| 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 17 matching lines...) Expand all Loading... |
| 28 #define StyleBuilderConverter_h | 28 #define StyleBuilderConverter_h |
| 29 | 29 |
| 30 #include "core/css/CSSValue.h" | 30 #include "core/css/CSSValue.h" |
| 31 #include "core/css/CSSValueList.h" | 31 #include "core/css/CSSValueList.h" |
| 32 #include "core/css/resolver/StyleResolverState.h" | 32 #include "core/css/resolver/StyleResolverState.h" |
| 33 #include "core/layout/LayoutView.h" | 33 #include "core/layout/LayoutView.h" |
| 34 #include "core/layout/style/QuotesData.h" | 34 #include "core/layout/style/QuotesData.h" |
| 35 #include "core/layout/style/ShadowList.h" | 35 #include "core/layout/style/ShadowList.h" |
| 36 #include "core/layout/style/StyleReflection.h" | 36 #include "core/layout/style/StyleReflection.h" |
| 37 #include "core/layout/style/TransformOrigin.h" | 37 #include "core/layout/style/TransformOrigin.h" |
| 38 #include "core/svg/SVGLength.h" | |
| 39 #include "platform/LengthSize.h" | 38 #include "platform/LengthSize.h" |
| 40 #include "platform/fonts/FontDescription.h" | 39 #include "platform/fonts/FontDescription.h" |
| 41 #include "platform/text/TabSize.h" | 40 #include "platform/text/TabSize.h" |
| 42 | 41 |
| 43 namespace blink { | 42 namespace blink { |
| 44 | 43 |
| 45 // Note that we assume the parser only allows valid CSSValue types. | 44 // Note that we assume the parser only allows valid CSSValue types. |
| 46 | 45 |
| 47 class StyleBuilderConverter { | 46 class StyleBuilderConverter { |
| 48 public: | 47 public: |
| 49 static PassRefPtr<StyleReflection> convertBoxReflect(StyleResolverState&, CS
SValue*); | 48 static PassRefPtr<StyleReflection> convertBoxReflect(StyleResolverState&, CS
SValue*); |
| 50 static AtomicString convertFragmentIdentifier(StyleResolverState&, CSSValue*
); | 49 static AtomicString convertFragmentIdentifier(StyleResolverState&, CSSValue*
); |
| 51 static Color convertColor(StyleResolverState&, CSSValue*, bool forVisitedLin
k = false); | 50 static Color convertColor(StyleResolverState&, CSSValue*, bool forVisitedLin
k = false); |
| 52 template <typename T> static T convertComputedLength(StyleResolverState&, CS
SValue*); | 51 template <typename T> static T convertComputedLength(StyleResolverState&, CS
SValue*); |
| 53 static LengthBox convertClip(StyleResolverState&, CSSValue*); | 52 static LengthBox convertClip(StyleResolverState&, CSSValue*); |
| 54 template <typename T> static T convertFlags(StyleResolverState&, CSSValue*); | 53 template <typename T> static T convertFlags(StyleResolverState&, CSSValue*); |
| 55 static FontDescription::FamilyDescription convertFontFamily(StyleResolverSta
te&, CSSValue*); | 54 static FontDescription::FamilyDescription convertFontFamily(StyleResolverSta
te&, CSSValue*); |
| 56 static PassRefPtr<FontFeatureSettings> convertFontFeatureSettings(StyleResol
verState&, CSSValue*); | 55 static PassRefPtr<FontFeatureSettings> convertFontFeatureSettings(StyleResol
verState&, CSSValue*); |
| 57 static FontDescription::Size convertFontSize(StyleResolverState&, CSSValue*)
; | 56 static FontDescription::Size convertFontSize(StyleResolverState&, CSSValue*)
; |
| 58 static float convertFontSizeAdjust(StyleResolverState&, CSSValue*); | 57 static float convertFontSizeAdjust(StyleResolverState&, CSSValue*); |
| 59 static FontWeight convertFontWeight(StyleResolverState&, CSSValue*); | 58 static FontWeight convertFontWeight(StyleResolverState&, CSSValue*); |
| 60 static FontDescription::VariantLigatures convertFontVariantLigatures(StyleRe
solverState&, CSSValue*); | 59 static FontDescription::VariantLigatures convertFontVariantLigatures(StyleRe
solverState&, CSSValue*); |
| 61 static EGlyphOrientation convertGlyphOrientation(StyleResolverState&, CSSVal
ue*); | 60 static EGlyphOrientation convertGlyphOrientation(StyleResolverState&, CSSVal
ue*); |
| 62 static GridAutoFlow convertGridAutoFlow(StyleResolverState&, CSSValue*); | 61 static GridAutoFlow convertGridAutoFlow(StyleResolverState&, CSSValue*); |
| 63 static GridPosition convertGridPosition(StyleResolverState&, CSSValue*); | 62 static GridPosition convertGridPosition(StyleResolverState&, CSSValue*); |
| 64 static GridTrackSize convertGridTrackSize(StyleResolverState&, CSSValue*); | 63 static GridTrackSize convertGridTrackSize(StyleResolverState&, CSSValue*); |
| 65 template <typename T> static T convertLineWidth(StyleResolverState&, CSSValu
e*); | 64 template <typename T> static T convertLineWidth(StyleResolverState&, CSSValu
e*); |
| 66 static Length convertLength(const StyleResolverState&, CSSValue*); | 65 static Length convertLength(const StyleResolverState&, CSSValue*); |
| 66 static UnzoomedLength convertUnzoomedLength(const StyleResolverState&, CSSVa
lue*); |
| 67 static Length convertLengthOrAuto(const StyleResolverState&, CSSValue*); | 67 static Length convertLengthOrAuto(const StyleResolverState&, CSSValue*); |
| 68 static Length convertLengthSizing(StyleResolverState&, CSSValue*); | 68 static Length convertLengthSizing(StyleResolverState&, CSSValue*); |
| 69 static Length convertLengthMaxSizing(StyleResolverState&, CSSValue*); | 69 static Length convertLengthMaxSizing(StyleResolverState&, CSSValue*); |
| 70 static TabSize convertLengthOrTabSpaces(StyleResolverState&, CSSValue*); | 70 static TabSize convertLengthOrTabSpaces(StyleResolverState&, CSSValue*); |
| 71 static LineBoxContain convertLineBoxContain(StyleResolverState&, CSSValue*); | 71 static LineBoxContain convertLineBoxContain(StyleResolverState&, CSSValue*); |
| 72 static Length convertLineHeight(StyleResolverState&, CSSValue*); | 72 static Length convertLineHeight(StyleResolverState&, CSSValue*); |
| 73 static float convertNumberOrPercentage(StyleResolverState&, CSSValue*); | 73 static float convertNumberOrPercentage(StyleResolverState&, CSSValue*); |
| 74 static LengthPoint convertObjectPosition(StyleResolverState&, CSSValue*); | 74 static LengthPoint convertObjectPosition(StyleResolverState&, CSSValue*); |
| 75 static float convertPerspective(StyleResolverState&, CSSValue*); | 75 static float convertPerspective(StyleResolverState&, CSSValue*); |
| 76 static LengthPoint convertPerspectiveOrigin(StyleResolverState&, CSSValue*); | 76 static LengthPoint convertPerspectiveOrigin(StyleResolverState&, CSSValue*); |
| 77 static Length convertQuirkyLength(StyleResolverState&, CSSValue*); | 77 static Length convertQuirkyLength(StyleResolverState&, CSSValue*); |
| 78 static PassRefPtr<QuotesData> convertQuotes(StyleResolverState&, CSSValue*); | 78 static PassRefPtr<QuotesData> convertQuotes(StyleResolverState&, CSSValue*); |
| 79 static LengthSize convertRadius(StyleResolverState&, CSSValue*); | 79 static LengthSize convertRadius(StyleResolverState&, CSSValue*); |
| 80 static EPaintOrder convertPaintOrder(StyleResolverState&, CSSValue*); | 80 static EPaintOrder convertPaintOrder(StyleResolverState&, CSSValue*); |
| 81 static PassRefPtr<ShadowList> convertShadow(StyleResolverState&, CSSValue*); | 81 static PassRefPtr<ShadowList> convertShadow(StyleResolverState&, CSSValue*); |
| 82 static PassRefPtr<ShapeValue> convertShapeValue(StyleResolverState&, CSSValu
e*); | 82 static PassRefPtr<ShapeValue> convertShapeValue(StyleResolverState&, CSSValu
e*); |
| 83 static float convertSpacing(StyleResolverState&, CSSValue*); | 83 static float convertSpacing(StyleResolverState&, CSSValue*); |
| 84 template <CSSValueID IdForNone> static AtomicString convertString(StyleResol
verState&, CSSValue*); | 84 template <CSSValueID IdForNone> static AtomicString convertString(StyleResol
verState&, CSSValue*); |
| 85 static PassRefPtr<SVGDashArray> convertStrokeDasharray(StyleResolverState&,
CSSValue*); | 85 static PassRefPtr<SVGDashArray> convertStrokeDasharray(StyleResolverState&,
CSSValue*); |
| 86 static StyleColor convertStyleColor(StyleResolverState&, CSSValue*, bool for
VisitedLink = false); | 86 static StyleColor convertStyleColor(StyleResolverState&, CSSValue*, bool for
VisitedLink = false); |
| 87 static Color convertSVGColor(StyleResolverState&, CSSValue*); | 87 static Color convertSVGColor(StyleResolverState&, CSSValue*); |
| 88 static PassRefPtrWillBeRawPtr<SVGLength> convertSVGLength(StyleResolverState
&, CSSValue*); | |
| 89 static float convertTextStrokeWidth(StyleResolverState&, CSSValue*); | 88 static float convertTextStrokeWidth(StyleResolverState&, CSSValue*); |
| 90 static TransformOrigin convertTransformOrigin(StyleResolverState&, CSSValue*
); | 89 static TransformOrigin convertTransformOrigin(StyleResolverState&, CSSValue*
); |
| 91 | 90 |
| 92 static bool convertGridTrackList(CSSValue*, Vector<GridTrackSize>&, NamedGri
dLinesMap&, OrderedNamedGridLines&, StyleResolverState&); | 91 static bool convertGridTrackList(CSSValue*, Vector<GridTrackSize>&, NamedGri
dLinesMap&, OrderedNamedGridLines&, StyleResolverState&); |
| 93 static void createImplicitNamedGridLinesFromGridArea(const NamedGridAreaMap&
, NamedGridLinesMap&, GridTrackSizingDirection); | 92 static void createImplicitNamedGridLinesFromGridArea(const NamedGridAreaMap&
, NamedGridLinesMap&, GridTrackSizingDirection); |
| 94 static void convertOrderedNamedGridLinesMapToNamedGridLinesMap(const Ordered
NamedGridLines&, NamedGridLinesMap&); | 93 static void convertOrderedNamedGridLinesMapToNamedGridLinesMap(const Ordered
NamedGridLines&, NamedGridLinesMap&); |
| 95 }; | 94 }; |
| 96 | 95 |
| 97 template <typename T> | 96 template <typename T> |
| 98 T StyleBuilderConverter::convertComputedLength(StyleResolverState& state, CSSVal
ue* value) | 97 T StyleBuilderConverter::convertComputedLength(StyleResolverState& state, CSSVal
ue* value) |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 { | 141 { |
| 143 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 142 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
| 144 if (primitiveValue->getValueID() == IdForNone) | 143 if (primitiveValue->getValueID() == IdForNone) |
| 145 return nullAtom; | 144 return nullAtom; |
| 146 return AtomicString(primitiveValue->getStringValue()); | 145 return AtomicString(primitiveValue->getStringValue()); |
| 147 } | 146 } |
| 148 | 147 |
| 149 } // namespace blink | 148 } // namespace blink |
| 150 | 149 |
| 151 #endif | 150 #endif |
| OLD | NEW |