Chromium Code Reviews| 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 16 matching lines...) Expand all Loading... | |
| 27 #ifndef StyleBuilderConverter_h | 27 #ifndef StyleBuilderConverter_h |
| 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/style/QuotesData.h" | 34 #include "core/style/QuotesData.h" |
| 35 #include "core/style/ShadowList.h" | 35 #include "core/style/ShadowList.h" |
| 36 #include "core/style/StyleReflection.h" | 36 #include "core/style/StyleReflection.h" |
| 37 #include "core/style/StyleScrollSnapData.h" | |
| 37 #include "core/style/TransformOrigin.h" | 38 #include "core/style/TransformOrigin.h" |
| 38 #include "platform/LengthSize.h" | 39 #include "platform/LengthSize.h" |
| 39 #include "platform/fonts/FontDescription.h" | 40 #include "platform/fonts/FontDescription.h" |
| 40 #include "platform/text/TabSize.h" | 41 #include "platform/text/TabSize.h" |
| 41 | 42 |
| 42 namespace blink { | 43 namespace blink { |
| 43 | 44 |
| 44 // Note that we assume the parser only allows valid CSSValue types. | 45 // Note that we assume the parser only allows valid CSSValue types. |
| 45 | 46 |
| 46 class StyleBuilderConverter { | 47 class StyleBuilderConverter { |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 66 template <typename T> static T convertLineWidth(StyleResolverState&, CSSValu e*); | 67 template <typename T> static T convertLineWidth(StyleResolverState&, CSSValu e*); |
| 67 static Length convertLength(const StyleResolverState&, CSSValue*); | 68 static Length convertLength(const StyleResolverState&, CSSValue*); |
| 68 static UnzoomedLength convertUnzoomedLength(const StyleResolverState&, CSSVa lue*); | 69 static UnzoomedLength convertUnzoomedLength(const StyleResolverState&, CSSVa lue*); |
| 69 static Length convertLengthOrAuto(const StyleResolverState&, CSSValue*); | 70 static Length convertLengthOrAuto(const StyleResolverState&, CSSValue*); |
| 70 static Length convertLengthSizing(StyleResolverState&, CSSValue*); | 71 static Length convertLengthSizing(StyleResolverState&, CSSValue*); |
| 71 static Length convertLengthMaxSizing(StyleResolverState&, CSSValue*); | 72 static Length convertLengthMaxSizing(StyleResolverState&, CSSValue*); |
| 72 static TabSize convertLengthOrTabSpaces(StyleResolverState&, CSSValue*); | 73 static TabSize convertLengthOrTabSpaces(StyleResolverState&, CSSValue*); |
| 73 static LineBoxContain convertLineBoxContain(StyleResolverState&, CSSValue*); | 74 static LineBoxContain convertLineBoxContain(StyleResolverState&, CSSValue*); |
| 74 static Length convertLineHeight(StyleResolverState&, CSSValue*); | 75 static Length convertLineHeight(StyleResolverState&, CSSValue*); |
| 75 static float convertNumberOrPercentage(StyleResolverState&, CSSValue*); | 76 static float convertNumberOrPercentage(StyleResolverState&, CSSValue*); |
| 76 static LengthPoint convertObjectPosition(StyleResolverState&, CSSValue*); | 77 static LengthPoint convertPosition(StyleResolverState&, CSSValue*); |
| 77 static float convertPerspective(StyleResolverState&, CSSValue*); | 78 static float convertPerspective(StyleResolverState&, CSSValue*); |
| 78 static LengthPoint convertPerspectiveOrigin(StyleResolverState&, CSSValue*); | 79 static LengthPoint convertPerspectiveOrigin(StyleResolverState&, CSSValue*); |
| 79 static Length convertQuirkyLength(StyleResolverState&, CSSValue*); | 80 static Length convertQuirkyLength(StyleResolverState&, CSSValue*); |
| 80 static PassRefPtr<QuotesData> convertQuotes(StyleResolverState&, CSSValue*); | 81 static PassRefPtr<QuotesData> convertQuotes(StyleResolverState&, CSSValue*); |
| 81 static LengthSize convertRadius(StyleResolverState&, CSSValue*); | 82 static LengthSize convertRadius(StyleResolverState&, CSSValue*); |
| 82 static EPaintOrder convertPaintOrder(StyleResolverState&, CSSValue*); | 83 static EPaintOrder convertPaintOrder(StyleResolverState&, CSSValue*); |
| 83 static PassRefPtr<ShadowList> convertShadow(StyleResolverState&, CSSValue*); | 84 static PassRefPtr<ShadowList> convertShadow(StyleResolverState&, CSSValue*); |
| 84 static PassRefPtr<ShapeValue> convertShapeValue(StyleResolverState&, CSSValu e*); | 85 static PassRefPtr<ShapeValue> convertShapeValue(StyleResolverState&, CSSValu e*); |
| 85 static float convertSpacing(StyleResolverState&, CSSValue*); | 86 static float convertSpacing(StyleResolverState&, CSSValue*); |
| 86 template <CSSValueID IdForNone> static AtomicString convertString(StyleResol verState&, CSSValue*); | 87 template <CSSValueID IdForNone> static AtomicString convertString(StyleResol verState&, CSSValue*); |
| 87 static PassRefPtr<SVGDashArray> convertStrokeDasharray(StyleResolverState&, CSSValue*); | 88 static PassRefPtr<SVGDashArray> convertStrokeDasharray(StyleResolverState&, CSSValue*); |
| 88 static StyleColor convertStyleColor(StyleResolverState&, CSSValue*, bool for VisitedLink = false); | 89 static StyleColor convertStyleColor(StyleResolverState&, CSSValue*, bool for VisitedLink = false); |
| 89 static Color convertSVGColor(StyleResolverState&, CSSValue*); | 90 static Color convertSVGColor(StyleResolverState&, CSSValue*); |
| 90 static float convertTextStrokeWidth(StyleResolverState&, CSSValue*); | 91 static float convertTextStrokeWidth(StyleResolverState&, CSSValue*); |
| 91 static TransformOrigin convertTransformOrigin(StyleResolverState&, CSSValue* ); | 92 static TransformOrigin convertTransformOrigin(StyleResolverState&, CSSValue* ); |
| 92 | 93 |
| 93 static bool convertGridTrackList(CSSValue*, Vector<GridTrackSize>&, NamedGri dLinesMap&, OrderedNamedGridLines&, StyleResolverState&); | 94 static bool convertGridTrackList(CSSValue*, Vector<GridTrackSize>&, NamedGri dLinesMap&, OrderedNamedGridLines&, StyleResolverState&); |
| 94 static void createImplicitNamedGridLinesFromGridArea(const NamedGridAreaMap& , NamedGridLinesMap&, GridTrackSizingDirection); | 95 static void createImplicitNamedGridLinesFromGridArea(const NamedGridAreaMap& , NamedGridLinesMap&, GridTrackSizingDirection); |
| 95 static void convertOrderedNamedGridLinesMapToNamedGridLinesMap(const Ordered NamedGridLines&, NamedGridLinesMap&); | 96 static void convertOrderedNamedGridLinesMapToNamedGridLinesMap(const Ordered NamedGridLines&, NamedGridLinesMap&); |
| 97 | |
| 98 static ScrollSnapPoints convertSnapPoints(StyleResolverState&, CSSValue*); | |
| 99 static Vector<LengthPoint> convertSnapCoordinates(StyleResolverState&, CSSVa lue*); | |
| 100 static LengthPoint convertSnapDestination(StyleResolverState&, CSSValue*); | |
| 101 | |
|
Timothy Loh
2015/06/04 03:58:26
extra blank line
majidvp
2015/06/04 22:41:40
Done.
| |
| 96 }; | 102 }; |
| 97 | 103 |
| 98 template <typename T> | 104 template <typename T> |
| 99 T StyleBuilderConverter::convertComputedLength(StyleResolverState& state, CSSVal ue* value) | 105 T StyleBuilderConverter::convertComputedLength(StyleResolverState& state, CSSVal ue* value) |
| 100 { | 106 { |
| 101 return toCSSPrimitiveValue(value)->computeLength<T>(state.cssToLengthConvers ionData()); | 107 return toCSSPrimitiveValue(value)->computeLength<T>(state.cssToLengthConvers ionData()); |
| 102 } | 108 } |
| 103 | 109 |
| 104 template <typename T> | 110 template <typename T> |
| 105 T StyleBuilderConverter::convertFlags(StyleResolverState& state, CSSValue* value ) | 111 T StyleBuilderConverter::convertFlags(StyleResolverState& state, CSSValue* value ) |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 143 { | 149 { |
| 144 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 150 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
| 145 if (primitiveValue->getValueID() == IdForNone) | 151 if (primitiveValue->getValueID() == IdForNone) |
| 146 return nullAtom; | 152 return nullAtom; |
| 147 return AtomicString(primitiveValue->getStringValue()); | 153 return AtomicString(primitiveValue->getStringValue()); |
| 148 } | 154 } |
| 149 | 155 |
| 150 } // namespace blink | 156 } // namespace blink |
| 151 | 157 |
| 152 #endif | 158 #endif |
| OLD | NEW |