Changeset 148645 in webkit


Ignore:
Timestamp:
Apr 17, 2013 4:29:02 PM (11 years ago)
Author:
krit@webkit.org
Message:

BasicShapeFunctions should use RenderStyle instead of StyleResolver
https://bugs.webkit.org/show_bug.cgi?id=114743

Reviewed by Antti Koivisto.

BasicShapeFunctions does include RenderStyle instead of StyleResolver now.
This is a simple refactoring patch, no new tests.

  • css/BasicShapeFunctions.cpp:

(WebCore::convertToLength): Use style and rootElementStyle directly.
(WebCore::basicShapeForValue): Ditto.

  • css/BasicShapeFunctions.h:

(WebCore):

  • css/DeprecatedStyleBuilder.cpp:

(WebCore::ApplyPropertyClipPath::applyValue):
(WebCore::ApplyPropertyExclusionShape::applyValue):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r148643 r148645  
     12013-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
    1202013-04-17  Beth Dakin  <bdakin@apple.com>
    221
  • trunk/Source/WebCore/css/BasicShapeFunctions.cpp

    r143885 r148645  
    3535#include "CSSPrimitiveValueMappings.h"
    3636#include "CSSValuePool.h"
    37 #include "StyleResolver.h"
     37#include "RenderStyle.h"
    3838
    3939namespace WebCore {
     
    101101}
    102102
    103 static Length convertToLength(const StyleResolver* styleResolver, CSSPrimitiveValue* value)
     103static Length convertToLength(const RenderStyle* style, const RenderStyle* rootStyle, CSSPrimitiveValue* value)
    104104{
    105     return value->convertToLength<FixedIntegerConversion | FixedFloatConversion | PercentConversion | ViewportPercentageConversion>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());
     105    return value->convertToLength<FixedIntegerConversion | FixedFloatConversion | PercentConversion | ViewportPercentageConversion>(style, rootStyle, style->effectiveZoom());
    106106}
    107107
    108 PassRefPtr<BasicShape> basicShapeForValue(const StyleResolver* styleResolver, const CSSBasicShape* basicShapeValue)
     108PassRefPtr<BasicShape> basicShapeForValue(const RenderStyle* style, const RenderStyle* rootStyle, const CSSBasicShape* basicShapeValue)
    109109{
    110110    RefPtr<BasicShape> basicShape;
     
    115115        RefPtr<BasicShapeRectangle> rect = BasicShapeRectangle::create();
    116116
    117         rect->setX(convertToLength(styleResolver, rectValue->x()));
    118         rect->setY(convertToLength(styleResolver, rectValue->y()));
    119         rect->setWidth(convertToLength(styleResolver, rectValue->width()));
    120         rect->setHeight(convertToLength(styleResolver, 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()));
    121121        if (rectValue->radiusX()) {
    122             rect->setCornerRadiusX(convertToLength(styleResolver, rectValue->radiusX()));
     122            rect->setCornerRadiusX(convertToLength(style, rootStyle, rectValue->radiusX()));
    123123            if (rectValue->radiusY())
    124                 rect->setCornerRadiusY(convertToLength(styleResolver, rectValue->radiusY()));
     124                rect->setCornerRadiusY(convertToLength(style, rootStyle, rectValue->radiusY()));
    125125        }
    126126        basicShape = rect.release();
     
    131131        RefPtr<BasicShapeCircle> circle = BasicShapeCircle::create();
    132132
    133         circle->setCenterX(convertToLength(styleResolver, circleValue->centerX()));
    134         circle->setCenterY(convertToLength(styleResolver, circleValue->centerY()));
    135         circle->setRadius(convertToLength(styleResolver, 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()));
    136136
    137137        basicShape = circle.release();
     
    142142        RefPtr<BasicShapeEllipse> ellipse = BasicShapeEllipse::create();
    143143
    144         ellipse->setCenterX(convertToLength(styleResolver, ellipseValue->centerX()));
    145         ellipse->setCenterY(convertToLength(styleResolver, ellipseValue->centerY()));
    146         ellipse->setRadiusX(convertToLength(styleResolver, ellipseValue->radiusX()));
    147         ellipse->setRadiusY(convertToLength(styleResolver, 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()));
    148148
    149149        basicShape = ellipse.release();
     
    157157        const Vector<RefPtr<CSSPrimitiveValue> >& values = polygonValue->values();
    158158        for (unsigned i = 0; i < values.size(); i += 2)
    159             polygon->appendPoint(convertToLength(styleResolver, 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()));
    160160
    161161        basicShape = polygon.release();
  • trunk/Source/WebCore/css/BasicShapeFunctions.h

    r143885 r148645  
    3838class CSSBasicShape;
    3939class CSSValue;
    40 class StyleResolver;
     40class RenderStyle;
    4141
    4242PassRefPtr<CSSValue> valueForBasicShape(const BasicShape*);
    43 PassRefPtr<BasicShape> basicShapeForValue(const StyleResolver*, const CSSBasicShape*);
     43PassRefPtr<BasicShape> basicShapeForValue(const RenderStyle*, const RenderStyle* rootStyle, const CSSBasicShape*);
    4444
    4545}
  • trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp

    r148414 r148645  
    19271927                setValue(styleResolver->style(), 0);
    19281928            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())));
    19301930            }
    19311931#if ENABLE(SVG)
     
    19611961                setValue(styleResolver->style(), ExclusionShapeValue::createOutsideValue());
    19621962            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()));
    19641964                setValue(styleResolver->style(), shape.release());
    19651965            }
Note: See TracChangeset for help on using the changeset viewer.