Changeset 148645 in webkit
- Timestamp:
- Apr 17, 2013 4:29:02 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r148643 r148645 1 2013-04-17 Dirk Schulze <krit@webkit.org> 2 3 BasicShapeFunctions should use RenderStyle instead of StyleResolver 4 https://bugs.webkit.org/show_bug.cgi?id=114743 5 6 Reviewed by Antti Koivisto. 7 8 BasicShapeFunctions does include RenderStyle instead of StyleResolver now. 9 This is a simple refactoring patch, no new tests. 10 11 * css/BasicShapeFunctions.cpp: 12 (WebCore::convertToLength): Use style and rootElementStyle directly. 13 (WebCore::basicShapeForValue): Ditto. 14 * css/BasicShapeFunctions.h: 15 (WebCore): 16 * css/DeprecatedStyleBuilder.cpp: 17 (WebCore::ApplyPropertyClipPath::applyValue): 18 (WebCore::ApplyPropertyExclusionShape::applyValue): 19 1 20 2013-04-17 Beth Dakin <bdakin@apple.com> 2 21 -
trunk/Source/WebCore/css/BasicShapeFunctions.cpp
r143885 r148645 35 35 #include "CSSPrimitiveValueMappings.h" 36 36 #include "CSSValuePool.h" 37 #include " StyleResolver.h"37 #include "RenderStyle.h" 38 38 39 39 namespace WebCore { … … 101 101 } 102 102 103 static Length convertToLength(const StyleResolver* styleResolver, CSSPrimitiveValue* value)103 static Length convertToLength(const RenderStyle* style, const RenderStyle* rootStyle, CSSPrimitiveValue* value) 104 104 { 105 return value->convertToLength<FixedIntegerConversion | FixedFloatConversion | PercentConversion | ViewportPercentageConversion>(style Resolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());105 return value->convertToLength<FixedIntegerConversion | FixedFloatConversion | PercentConversion | ViewportPercentageConversion>(style, rootStyle, style->effectiveZoom()); 106 106 } 107 107 108 PassRefPtr<BasicShape> basicShapeForValue(const StyleResolver* styleResolver, const CSSBasicShape* basicShapeValue)108 PassRefPtr<BasicShape> basicShapeForValue(const RenderStyle* style, const RenderStyle* rootStyle, const CSSBasicShape* basicShapeValue) 109 109 { 110 110 RefPtr<BasicShape> basicShape; … … 115 115 RefPtr<BasicShapeRectangle> rect = BasicShapeRectangle::create(); 116 116 117 rect->setX(convertToLength(style Resolver, rectValue->x()));118 rect->setY(convertToLength(style Resolver, rectValue->y()));119 rect->setWidth(convertToLength(style Resolver, rectValue->width()));120 rect->setHeight(convertToLength(style Resolver, rectValue->height()));117 rect->setX(convertToLength(style, rootStyle, rectValue->x())); 118 rect->setY(convertToLength(style, rootStyle, rectValue->y())); 119 rect->setWidth(convertToLength(style, rootStyle, rectValue->width())); 120 rect->setHeight(convertToLength(style, rootStyle, rectValue->height())); 121 121 if (rectValue->radiusX()) { 122 rect->setCornerRadiusX(convertToLength(style Resolver, rectValue->radiusX()));122 rect->setCornerRadiusX(convertToLength(style, rootStyle, rectValue->radiusX())); 123 123 if (rectValue->radiusY()) 124 rect->setCornerRadiusY(convertToLength(style Resolver, rectValue->radiusY()));124 rect->setCornerRadiusY(convertToLength(style, rootStyle, rectValue->radiusY())); 125 125 } 126 126 basicShape = rect.release(); … … 131 131 RefPtr<BasicShapeCircle> circle = BasicShapeCircle::create(); 132 132 133 circle->setCenterX(convertToLength(style Resolver, circleValue->centerX()));134 circle->setCenterY(convertToLength(style Resolver, circleValue->centerY()));135 circle->setRadius(convertToLength(style Resolver, circleValue->radius()));133 circle->setCenterX(convertToLength(style, rootStyle, circleValue->centerX())); 134 circle->setCenterY(convertToLength(style, rootStyle, circleValue->centerY())); 135 circle->setRadius(convertToLength(style, rootStyle, circleValue->radius())); 136 136 137 137 basicShape = circle.release(); … … 142 142 RefPtr<BasicShapeEllipse> ellipse = BasicShapeEllipse::create(); 143 143 144 ellipse->setCenterX(convertToLength(style Resolver, ellipseValue->centerX()));145 ellipse->setCenterY(convertToLength(style Resolver, ellipseValue->centerY()));146 ellipse->setRadiusX(convertToLength(style Resolver, ellipseValue->radiusX()));147 ellipse->setRadiusY(convertToLength(style Resolver, ellipseValue->radiusY()));144 ellipse->setCenterX(convertToLength(style, rootStyle, ellipseValue->centerX())); 145 ellipse->setCenterY(convertToLength(style, rootStyle, ellipseValue->centerY())); 146 ellipse->setRadiusX(convertToLength(style, rootStyle, ellipseValue->radiusX())); 147 ellipse->setRadiusY(convertToLength(style, rootStyle, ellipseValue->radiusY())); 148 148 149 149 basicShape = ellipse.release(); … … 157 157 const Vector<RefPtr<CSSPrimitiveValue> >& values = polygonValue->values(); 158 158 for (unsigned i = 0; i < values.size(); i += 2) 159 polygon->appendPoint(convertToLength(style Resolver, values.at(i).get()), convertToLength(styleResolver, values.at(i + 1).get()));159 polygon->appendPoint(convertToLength(style, rootStyle, values.at(i).get()), convertToLength(style, rootStyle, values.at(i + 1).get())); 160 160 161 161 basicShape = polygon.release(); -
trunk/Source/WebCore/css/BasicShapeFunctions.h
r143885 r148645 38 38 class CSSBasicShape; 39 39 class CSSValue; 40 class StyleResolver;40 class RenderStyle; 41 41 42 42 PassRefPtr<CSSValue> valueForBasicShape(const BasicShape*); 43 PassRefPtr<BasicShape> basicShapeForValue(const StyleResolver*, const CSSBasicShape*);43 PassRefPtr<BasicShape> basicShapeForValue(const RenderStyle*, const RenderStyle* rootStyle, const CSSBasicShape*); 44 44 45 45 } -
trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp
r148414 r148645 1927 1927 setValue(styleResolver->style(), 0); 1928 1928 else if (primitiveValue->isShape()) { 1929 setValue(styleResolver->style(), ShapeClipPathOperation::create(basicShapeForValue(styleResolver , primitiveValue->getShapeValue())));1929 setValue(styleResolver->style(), ShapeClipPathOperation::create(basicShapeForValue(styleResolver->style(), styleResolver->rootElementStyle(), primitiveValue->getShapeValue()))); 1930 1930 } 1931 1931 #if ENABLE(SVG) … … 1961 1961 setValue(styleResolver->style(), ExclusionShapeValue::createOutsideValue()); 1962 1962 else if (primitiveValue->isShape()) { 1963 RefPtr<ExclusionShapeValue> shape = ExclusionShapeValue::createShapeValue(basicShapeForValue(styleResolver , primitiveValue->getShapeValue()));1963 RefPtr<ExclusionShapeValue> shape = ExclusionShapeValue::createShapeValue(basicShapeForValue(styleResolver->style(), styleResolver->rootElementStyle(), primitiveValue->getShapeValue())); 1964 1964 setValue(styleResolver->style(), shape.release()); 1965 1965 }
Note: See TracChangeset
for help on using the changeset viewer.