Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp

Issue 1407123011: Use a converter to resolve style for -webkit-filter and backdrop-filter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 22 matching lines...) Expand all
33 #include "core/css/CSSFontFeatureValue.h" 33 #include "core/css/CSSFontFeatureValue.h"
34 #include "core/css/CSSFunctionValue.h" 34 #include "core/css/CSSFunctionValue.h"
35 #include "core/css/CSSGridLineNamesValue.h" 35 #include "core/css/CSSGridLineNamesValue.h"
36 #include "core/css/CSSPrimitiveValueMappings.h" 36 #include "core/css/CSSPrimitiveValueMappings.h"
37 #include "core/css/CSSQuadValue.h" 37 #include "core/css/CSSQuadValue.h"
38 #include "core/css/CSSReflectValue.h" 38 #include "core/css/CSSReflectValue.h"
39 #include "core/css/CSSShadowValue.h" 39 #include "core/css/CSSShadowValue.h"
40 #include "core/css/CSSStringValue.h" 40 #include "core/css/CSSStringValue.h"
41 #include "core/css/CSSURIValue.h" 41 #include "core/css/CSSURIValue.h"
42 #include "core/css/CSSValuePair.h" 42 #include "core/css/CSSValuePair.h"
43 #include "core/svg/SVGElement.h" 43 #include "core/css/resolver/FilterOperationResolver.h"
44 #include "core/svg/SVGURIReference.h" 44 #include "core/svg/SVGURIReference.h"
45 #include "platform/transforms/RotateTransformOperation.h" 45 #include "platform/transforms/RotateTransformOperation.h"
46 #include "platform/transforms/ScaleTransformOperation.h" 46 #include "platform/transforms/ScaleTransformOperation.h"
47 #include "platform/transforms/TranslateTransformOperation.h" 47 #include "platform/transforms/TranslateTransformOperation.h"
48 48
49 namespace blink { 49 namespace blink {
50 50
51 namespace { 51 namespace {
52 52
53 static GridLength convertGridTrackBreadth(const StyleResolverState& state, const CSSPrimitiveValue& primitiveValue) 53 static GridLength convertGridTrackBreadth(const StyleResolverState& state, const CSSPrimitiveValue& primitiveValue)
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 LengthBox StyleBuilderConverter::convertClip(StyleResolverState& state, const CS SValue& value) 104 LengthBox StyleBuilderConverter::convertClip(StyleResolverState& state, const CS SValue& value)
105 { 105 {
106 const CSSQuadValue& rect = toCSSQuadValue(value); 106 const CSSQuadValue& rect = toCSSQuadValue(value);
107 107
108 return LengthBox(convertLengthOrAuto(state, *rect.top()), 108 return LengthBox(convertLengthOrAuto(state, *rect.top()),
109 convertLengthOrAuto(state, *rect.right()), 109 convertLengthOrAuto(state, *rect.right()),
110 convertLengthOrAuto(state, *rect.bottom()), 110 convertLengthOrAuto(state, *rect.bottom()),
111 convertLengthOrAuto(state, *rect.left())); 111 convertLengthOrAuto(state, *rect.left()));
112 } 112 }
113 113
114 FilterOperations StyleBuilderConverter::convertFilterOperations(StyleResolverSta te& state, const CSSValue& value)
115 {
116 return FilterOperationResolver::createFilterOperations(state, value);
117 }
118
114 static FontDescription::GenericFamilyType convertGenericFamily(CSSValueID valueI D) 119 static FontDescription::GenericFamilyType convertGenericFamily(CSSValueID valueI D)
115 { 120 {
116 switch (valueID) { 121 switch (valueID) {
117 case CSSValueWebkitBody: 122 case CSSValueWebkitBody:
118 return FontDescription::StandardFamily; 123 return FontDescription::StandardFamily;
119 case CSSValueSerif: 124 case CSSValueSerif:
120 return FontDescription::SerifFamily; 125 return FontDescription::SerifFamily;
121 case CSSValueSansSerif: 126 case CSSValueSansSerif:
122 return FontDescription::SansSerifFamily; 127 return FontDescription::SansSerifFamily;
123 case CSSValueCursive: 128 case CSSValueCursive:
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 return ScaleTransformOperation::create(sx, sy, sz, TransformOperation::Scale 3D); 947 return ScaleTransformOperation::create(sx, sy, sz, TransformOperation::Scale 3D);
943 } 948 }
944 949
945 RespectImageOrientationEnum StyleBuilderConverter::convertImageOrientation(Style ResolverState& state, const CSSValue& value) 950 RespectImageOrientationEnum StyleBuilderConverter::convertImageOrientation(Style ResolverState& state, const CSSValue& value)
946 { 951 {
947 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); 952 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value);
948 return primitiveValue.getValueID() == CSSValueFromImage ? RespectImageOrient ation : DoNotRespectImageOrientation; 953 return primitiveValue.getValueID() == CSSValueFromImage ? RespectImageOrient ation : DoNotRespectImageOrientation;
949 } 954 }
950 955
951 } // namespace blink 956 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698