Changeset 168481 in webkit


Ignore:
Timestamp:
May 8, 2014 12:14:33 PM (10 years ago)
Author:
Bem Jones-Bey
Message:

[CSS Shapes] Shapes do not resolve dimensions specified in viewport units
https://bugs.webkit.org/show_bug.cgi?id=124052

Reviewed by Dirk Schulze.

Source/WebCore:
Viewport unit resolution doesn't work unless the RenderView is passed
down into the floatValueForLength methods. All this does is plumb down
a RenderView in all of these cases.

Tests: css3/masking/clip-path-polygon-viewport-units.html

fast/shapes/shape-outside-floats/shape-outside-floats-viewport-units.html

  • css/BasicShapeFunctions.cpp:

(WebCore::floatValueForCenterCoordinate):

  • css/BasicShapeFunctions.h:
  • css/LengthFunctions.cpp:

(WebCore::floatSizeForLengthSize):

  • css/LengthFunctions.h:
  • rendering/ClipPathOperation.h:

(WebCore::ShapeClipPathOperation::pathForReferenceRect):
(WebCore::BoxClipPathOperation::pathForReferenceRect):

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::setupClipPath):

  • rendering/shapes/Shape.cpp:

(WebCore::Shape::createShape):

  • rendering/shapes/Shape.h:
  • rendering/shapes/ShapeOutsideInfo.cpp:

(WebCore::ShapeOutsideInfo::computedShape):

  • rendering/style/BasicShapes.cpp:

(WebCore::BasicShapeCircle::floatValueForRadiusInBox):
(WebCore::BasicShapeCircle::path):
(WebCore::BasicShapeEllipse::floatValueForRadiusInBox):
(WebCore::BasicShapeEllipse::path):
(WebCore::BasicShapePolygon::path):
(WebCore::floatSizeForLengthSize):
(WebCore::BasicShapeInset::path):

  • rendering/style/BasicShapes.h:
  • rendering/svg/SVGRenderingContext.cpp:

(WebCore::SVGRenderingContext::prepareToRenderSVGContent):

LayoutTests:

  • css3/masking/clip-path-polygon-viewport-units-expected.html: Added.
  • css3/masking/clip-path-polygon-viewport-units.html: Added.
  • fast/shapes/shape-outside-floats/shape-outside-floats-viewport-units-expected.html: Added.
  • fast/shapes/shape-outside-floats/shape-outside-floats-viewport-units.html: Added.
Location:
trunk
Files:
4 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r168476 r168481  
     12014-05-08  Bem Jones-Bey  <bjonesbe@adobe.com>
     2
     3        [CSS Shapes] Shapes do not resolve dimensions specified in viewport units
     4        https://bugs.webkit.org/show_bug.cgi?id=124052
     5
     6        Reviewed by Dirk Schulze.
     7
     8        * css3/masking/clip-path-polygon-viewport-units-expected.html: Added.
     9        * css3/masking/clip-path-polygon-viewport-units.html: Added.
     10        * fast/shapes/shape-outside-floats/shape-outside-floats-viewport-units-expected.html: Added.
     11        * fast/shapes/shape-outside-floats/shape-outside-floats-viewport-units.html: Added.
     12
    1132014-05-08  Rik Cabanier  <cabanier@adobe.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r168479 r168481  
     12014-05-08  Bem Jones-Bey  <bjonesbe@adobe.com>
     2
     3        [CSS Shapes] Shapes do not resolve dimensions specified in viewport units
     4        https://bugs.webkit.org/show_bug.cgi?id=124052
     5
     6        Reviewed by Dirk Schulze.
     7
     8        Viewport unit resolution doesn't work unless the RenderView is passed
     9        down into the floatValueForLength methods. All this does is plumb down
     10        a RenderView in all of these cases.
     11
     12        Tests: css3/masking/clip-path-polygon-viewport-units.html
     13               fast/shapes/shape-outside-floats/shape-outside-floats-viewport-units.html
     14
     15        * css/BasicShapeFunctions.cpp:
     16        (WebCore::floatValueForCenterCoordinate):
     17        * css/BasicShapeFunctions.h:
     18        * css/LengthFunctions.cpp:
     19        (WebCore::floatSizeForLengthSize):
     20        * css/LengthFunctions.h:
     21        * rendering/ClipPathOperation.h:
     22        (WebCore::ShapeClipPathOperation::pathForReferenceRect):
     23        (WebCore::BoxClipPathOperation::pathForReferenceRect):
     24        * rendering/RenderLayer.cpp:
     25        (WebCore::RenderLayer::setupClipPath):
     26        * rendering/shapes/Shape.cpp:
     27        (WebCore::Shape::createShape):
     28        * rendering/shapes/Shape.h:
     29        * rendering/shapes/ShapeOutsideInfo.cpp:
     30        (WebCore::ShapeOutsideInfo::computedShape):
     31        * rendering/style/BasicShapes.cpp:
     32        (WebCore::BasicShapeCircle::floatValueForRadiusInBox):
     33        (WebCore::BasicShapeCircle::path):
     34        (WebCore::BasicShapeEllipse::floatValueForRadiusInBox):
     35        (WebCore::BasicShapeEllipse::path):
     36        (WebCore::BasicShapePolygon::path):
     37        (WebCore::floatSizeForLengthSize):
     38        (WebCore::BasicShapeInset::path):
     39        * rendering/style/BasicShapes.h:
     40        * rendering/svg/SVGRenderingContext.cpp:
     41        (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
     42
    1432014-05-08  Brent Fulgham  <bfulgham@apple.com>
    244
  • trunk/Source/WebCore/css/BasicShapeFunctions.cpp

    r167937 r168481  
    3737#include "Pair.h"
    3838#include "RenderStyle.h"
     39#include "RenderView.h"
    3940
    4041namespace WebCore {
     
    265266}
    266267
    267 float floatValueForCenterCoordinate(const BasicShapeCenterCoordinate& center, float boxDimension)
    268 {
    269     float offset = floatValueForLength(center.length(), boxDimension);
     268float floatValueForCenterCoordinate(const BasicShapeCenterCoordinate& center, float boxDimension, RenderView* view)
     269{
     270    float offset = floatValueForLength(center.length(), boxDimension, view);
    270271    if (center.direction() == BasicShapeCenterCoordinate::TopLeft)
    271272        return offset;
  • trunk/Source/WebCore/css/BasicShapeFunctions.h

    r167937 r168481  
    4141class CSSValue;
    4242class RenderStyle;
     43class RenderView;
    4344
    4445PassRefPtr<CSSValue> valueForBasicShape(const RenderStyle*, const BasicShape*);
    4546PassRefPtr<BasicShape> basicShapeForValue(const CSSToLengthConversionData&, const CSSBasicShape*);
    4647
    47 float floatValueForCenterCoordinate(const BasicShapeCenterCoordinate&, float);
     48float floatValueForCenterCoordinate(const BasicShapeCenterCoordinate&, float, RenderView*);
    4849}
    4950
  • trunk/Source/WebCore/css/LengthFunctions.cpp

    r166860 r168481  
    211211}
    212212
    213 FloatSize floatSizeForLengthSize(const LengthSize& lengthSize, const FloatSize& boxSize)
    214 {
    215     return FloatSize(floatValueForLength(lengthSize.width(), boxSize.width()), floatValueForLength(lengthSize.height(), boxSize.height()));
     213FloatSize floatSizeForLengthSize(const LengthSize& lengthSize, const FloatSize& boxSize, RenderView* view)
     214{
     215    return FloatSize(floatValueForLength(lengthSize.width(), boxSize.width(), view), floatValueForLength(lengthSize.height(), boxSize.height(), view));
    216216}
    217217
  • trunk/Source/WebCore/css/LengthFunctions.h

    r163585 r168481  
    3939float floatValueForLength(const Length&, LayoutUnit maximumValue, RenderView* = 0);
    4040float floatValueForLength(const Length&, float maximumValue, RenderView* = 0);
    41 FloatSize floatSizeForLengthSize(const LengthSize&, const FloatSize&);
     41FloatSize floatSizeForLengthSize(const LengthSize&, const FloatSize&, RenderView* = 0);
    4242
    4343} // namespace WebCore
  • trunk/Source/WebCore/rendering/ClipPathOperation.h

    r166489 r168481  
    103103    const BasicShape* basicShape() const { return m_shape.get(); }
    104104    WindRule windRule() const { return m_shape->windRule(); }
    105     const Path pathForReferenceRect(const FloatRect& boundingRect) const
     105    const Path pathForReferenceRect(const FloatRect& boundingRect, RenderView* view) const
    106106    {
    107107        ASSERT(m_shape);
    108108        Path path;
    109         m_shape->path(path, boundingRect);
     109        m_shape->path(path, boundingRect, view);
    110110        return path;
    111111    }
     
    141141    }
    142142
    143     const Path pathForReferenceRect(const RoundedRect& boundingRect) const
     143    const Path pathForReferenceRect(const RoundedRect& boundingRect, RenderView*) const
    144144    {
    145145        Path path;
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r168463 r168481  
    25082508                referenceBoxRect = borderBoxRect();
    25092509            }
    2510             if (!clipPath->pathForReferenceRect(referenceBoxRect).contains(locationInContainer.point() - localOffset, clipPath->windRule()))
     2510            if (!clipPath->pathForReferenceRect(referenceBoxRect, &view()).contains(locationInContainer.point() - localOffset, clipPath->windRule()))
    25112511                return false;
    25122512            break;
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r168468 r168481  
    38433843        LayoutRect referenceBox = computeReferenceBox(renderer(), clippingPath, offsetFromRoot, rootRelativeBounds);
    38443844        context->save();
    3845         context->clipPath(clippingPath.pathForReferenceRect(referenceBox), clippingPath.windRule());
     3845        context->clipPath(clippingPath.pathForReferenceRect(referenceBox, &m_renderer.view()), clippingPath.windRule());
    38463846        return true;
    38473847    }
     
    38543854
    38553855        context->save();
    3856         context->clipPath(clippingPath.pathForReferenceRect(shapeRect), RULE_NONZERO);
     3856        context->clipPath(clippingPath.pathForReferenceRect(shapeRect, &m_renderer.view()), RULE_NONZERO);
    38573857        return true;
    38583858    }
  • trunk/Source/WebCore/rendering/shapes/Shape.cpp

    r167938 r168481  
    9191}
    9292
    93 std::unique_ptr<Shape> Shape::createShape(const BasicShape* basicShape, const LayoutSize& logicalBoxSize, WritingMode writingMode, float margin)
     93std::unique_ptr<Shape> Shape::createShape(const BasicShape* basicShape, const LayoutSize& logicalBoxSize, WritingMode writingMode, float margin, RenderView* view)
    9494{
    9595    ASSERT(basicShape);
     
    104104    case BasicShape::BasicShapeCircleType: {
    105105        const BasicShapeCircle* circle = static_cast<const BasicShapeCircle*>(basicShape);
    106         float centerX = floatValueForCenterCoordinate(circle->centerX(), boxWidth);
    107         float centerY = floatValueForCenterCoordinate(circle->centerY(), boxHeight);
    108         float radius = circle->floatValueForRadiusInBox(boxWidth, boxHeight);
     106        float centerX = floatValueForCenterCoordinate(circle->centerX(), boxWidth, view);
     107        float centerY = floatValueForCenterCoordinate(circle->centerY(), boxHeight, view);
     108        float radius = circle->floatValueForRadiusInBox(boxWidth, boxHeight, view);
    109109        FloatPoint logicalCenter = physicalPointToLogical(FloatPoint(centerX, centerY), logicalBoxSize.height(), writingMode);
    110110
     
    115115    case BasicShape::BasicShapeEllipseType: {
    116116        const BasicShapeEllipse* ellipse = static_cast<const BasicShapeEllipse*>(basicShape);
    117         float centerX = floatValueForCenterCoordinate(ellipse->centerX(), boxWidth);
    118         float centerY = floatValueForCenterCoordinate(ellipse->centerY(), boxHeight);
    119         float radiusX = ellipse->floatValueForRadiusInBox(ellipse->radiusX(), centerX, boxWidth);
    120         float radiusY = ellipse->floatValueForRadiusInBox(ellipse->radiusY(), centerY, boxHeight);
     117        float centerX = floatValueForCenterCoordinate(ellipse->centerX(), boxWidth, view);
     118        float centerY = floatValueForCenterCoordinate(ellipse->centerY(), boxHeight, view);
     119        float radiusX = ellipse->floatValueForRadiusInBox(ellipse->radiusX(), centerX, boxWidth, view);
     120        float radiusY = ellipse->floatValueForRadiusInBox(ellipse->radiusY(), centerY, boxHeight, view);
    121121        FloatPoint logicalCenter = physicalPointToLogical(FloatPoint(centerX, centerY), logicalBoxSize.height(), writingMode);
    122122
     
    133133        for (unsigned i = 0; i < valuesSize; i += 2) {
    134134            FloatPoint vertex(
    135                 floatValueForLength(values.at(i), boxWidth),
    136                 floatValueForLength(values.at(i + 1), boxHeight));
     135                floatValueForLength(values.at(i), boxWidth, view),
     136                floatValueForLength(values.at(i + 1), boxHeight, view));
    137137            (*vertices)[i / 2] = physicalPointToLogical(vertex, logicalBoxSize.height(), writingMode);
    138138        }
     
    144144    case BasicShape::BasicShapeInsetType: {
    145145        const BasicShapeInset& inset = *static_cast<const BasicShapeInset*>(basicShape);
    146         float left = floatValueForLength(inset.left(), boxWidth);
    147         float top = floatValueForLength(inset.top(), boxHeight);
     146        float left = floatValueForLength(inset.left(), boxWidth, view);
     147        float top = floatValueForLength(inset.top(), boxHeight, view);
    148148        FloatRect rect(left,
    149149            top,
    150             std::max<float>(boxWidth - left - floatValueForLength(inset.right(), boxWidth), 0),
    151             std::max<float>(boxHeight - top - floatValueForLength(inset.bottom(), boxHeight), 0));
     150            std::max<float>(boxWidth - left - floatValueForLength(inset.right(), boxWidth, view), 0),
     151            std::max<float>(boxHeight - top - floatValueForLength(inset.bottom(), boxHeight, view), 0));
    152152        FloatRect logicalRect = physicalRectToLogical(rect, logicalBoxSize.height(), writingMode);
    153153
    154154        FloatSize boxSize(boxWidth, boxHeight);
    155         FloatSize topLeftRadius = physicalSizeToLogical(floatSizeForLengthSize(inset.topLeftRadius(), boxSize), writingMode);
    156         FloatSize topRightRadius = physicalSizeToLogical(floatSizeForLengthSize(inset.topRightRadius(), boxSize), writingMode);
    157         FloatSize bottomLeftRadius = physicalSizeToLogical(floatSizeForLengthSize(inset.bottomLeftRadius(), boxSize), writingMode);
    158         FloatSize bottomRightRadius = physicalSizeToLogical(floatSizeForLengthSize(inset.bottomRightRadius(), boxSize), writingMode);
     155        FloatSize topLeftRadius = physicalSizeToLogical(floatSizeForLengthSize(inset.topLeftRadius(), boxSize, view), writingMode);
     156        FloatSize topRightRadius = physicalSizeToLogical(floatSizeForLengthSize(inset.topRightRadius(), boxSize, view), writingMode);
     157        FloatSize bottomLeftRadius = physicalSizeToLogical(floatSizeForLengthSize(inset.bottomLeftRadius(), boxSize, view), writingMode);
     158        FloatSize bottomRightRadius = physicalSizeToLogical(floatSizeForLengthSize(inset.bottomRightRadius(), boxSize, view), writingMode);
    159159        FloatRoundedRect::Radii cornerRadii(topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
    160160
  • trunk/Source/WebCore/rendering/shapes/Shape.h

    r167395 r168481  
    5050class BasicShape;
    5151class Image;
     52class RenderView;
    5253class RoundedRect;
    5354
     
    6768    };
    6869
    69     static std::unique_ptr<Shape> createShape(const BasicShape*, const LayoutSize& logicalBoxSize, WritingMode, float margin);
     70    static std::unique_ptr<Shape> createShape(const BasicShape*, const LayoutSize& logicalBoxSize, WritingMode, float margin, RenderView*);
    7071    static std::unique_ptr<Shape> createRasterShape(Image*, float threshold, const LayoutRect& imageRect, const LayoutRect& marginRect, WritingMode, float margin);
    7172    static std::unique_ptr<Shape> createBoxShape(const RoundedRect&, WritingMode, float margin);
  • trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp

    r167518 r168481  
    175175
    176176    WritingMode writingMode = containingBlockStyle.writingMode();
    177     float margin = floatValueForLength(m_renderer.style().shapeMargin(), m_renderer.containingBlock() ? m_renderer.containingBlock()->contentWidth() : LayoutUnit());
     177    float margin = floatValueForLength(m_renderer.style().shapeMargin(), m_renderer.containingBlock() ? m_renderer.containingBlock()->contentWidth() : LayoutUnit(), &m_renderer.view());
    178178    float shapeImageThreshold = style.shapeImageThreshold();
    179179    const ShapeValue& shapeValue = *style.shapeOutside();
     
    182182    case ShapeValue::Shape:
    183183        ASSERT(shapeValue.shape());
    184         m_shape = Shape::createShape(shapeValue.shape(), m_referenceBoxLogicalSize, writingMode, margin);
     184        m_shape = Shape::createShape(shapeValue.shape(), m_referenceBoxLogicalSize, writingMode, margin, &m_renderer.view());
    185185        break;
    186186    case ShapeValue::Image: {
  • trunk/Source/WebCore/rendering/style/BasicShapes.cpp

    r166830 r168481  
    8989}
    9090
    91 float BasicShapeCircle::floatValueForRadiusInBox(float boxWidth, float boxHeight) const
     91float BasicShapeCircle::floatValueForRadiusInBox(float boxWidth, float boxHeight, RenderView* view) const
    9292{
    9393    if (m_radius.type() == BasicShapeRadius::Value)
    9494        return floatValueForLength(m_radius.value(), sqrtf((boxWidth * boxWidth + boxHeight * boxHeight) / 2));
    9595
    96     float centerX = floatValueForCenterCoordinate(m_centerX, boxWidth);
    97     float centerY = floatValueForCenterCoordinate(m_centerY, boxHeight);
     96    float centerX = floatValueForCenterCoordinate(m_centerX, boxWidth, view);
     97    float centerY = floatValueForCenterCoordinate(m_centerY, boxHeight, view);
    9898
    9999    if (m_radius.type() == BasicShapeRadius::ClosestSide)
     
    104104}
    105105
    106 void BasicShapeCircle::path(Path& path, const FloatRect& boundingBox)
    107 {
    108     ASSERT(path.isEmpty());
    109 
    110     float centerX = floatValueForCenterCoordinate(m_centerX, boundingBox.width());
    111     float centerY = floatValueForCenterCoordinate(m_centerY, boundingBox.height());
    112     float radius = floatValueForRadiusInBox(boundingBox.width(), boundingBox.height());
     106void BasicShapeCircle::path(Path& path, const FloatRect& boundingBox, RenderView* view)
     107{
     108    ASSERT(path.isEmpty());
     109
     110    float centerX = floatValueForCenterCoordinate(m_centerX, boundingBox.width(), view);
     111    float centerY = floatValueForCenterCoordinate(m_centerY, boundingBox.height(), view);
     112    float radius = floatValueForRadiusInBox(boundingBox.width(), boundingBox.height(), view);
    113113    path.addEllipse(FloatRect(
    114114        centerX - radius + boundingBox.x(),
     
    131131}
    132132
    133 float BasicShapeEllipse::floatValueForRadiusInBox(const BasicShapeRadius& radius, float center, float boxWidthOrHeight) const
     133float BasicShapeEllipse::floatValueForRadiusInBox(const BasicShapeRadius& radius, float center, float boxWidthOrHeight, RenderView* view) const
    134134{
    135135    if (radius.type() == BasicShapeRadius::Value)
    136         return floatValueForLength(radius.value(), boxWidthOrHeight);
     136        return floatValueForLength(radius.value(), boxWidthOrHeight, view);
    137137
    138138    if (radius.type() == BasicShapeRadius::ClosestSide)
     
    143143}
    144144
    145 void BasicShapeEllipse::path(Path& path, const FloatRect& boundingBox)
    146 {
    147     ASSERT(path.isEmpty());
    148 
    149     float centerX = floatValueForCenterCoordinate(m_centerX, boundingBox.width());
    150     float centerY = floatValueForCenterCoordinate(m_centerY, boundingBox.height());
    151     float radiusX = floatValueForRadiusInBox(m_radiusX, centerX, boundingBox.width());
    152     float radiusY = floatValueForRadiusInBox(m_radiusY, centerY, boundingBox.height());
     145void BasicShapeEllipse::path(Path& path, const FloatRect& boundingBox, RenderView* view)
     146{
     147    ASSERT(path.isEmpty());
     148
     149    float centerX = floatValueForCenterCoordinate(m_centerX, boundingBox.width(), view);
     150    float centerY = floatValueForCenterCoordinate(m_centerY, boundingBox.height(), view);
     151    float radiusX = floatValueForRadiusInBox(m_radiusX, centerX, boundingBox.width(), view);
     152    float radiusY = floatValueForRadiusInBox(m_radiusY, centerY, boundingBox.height(), view);
    153153    path.addEllipse(FloatRect(
    154154        centerX - radiusX + boundingBox.x(),
     
    180180}
    181181
    182 void BasicShapePolygon::path(Path& path, const FloatRect& boundingBox)
     182void BasicShapePolygon::path(Path& path, const FloatRect& boundingBox, RenderView* view)
    183183{
    184184    ASSERT(path.isEmpty());
     
    189189        return;
    190190
    191     path.moveTo(FloatPoint(floatValueForLength(m_values.at(0), boundingBox.width()) + boundingBox.x(),
    192         floatValueForLength(m_values.at(1), boundingBox.height()) + boundingBox.y()));
     191    path.moveTo(FloatPoint(floatValueForLength(m_values.at(0), boundingBox.width(), view) + boundingBox.x(),
     192        floatValueForLength(m_values.at(1), boundingBox.height(), view) + boundingBox.y()));
    193193    for (size_t i = 2; i < length; i = i + 2) {
    194         path.addLineTo(FloatPoint(floatValueForLength(m_values.at(i), boundingBox.width()) + boundingBox.x(),
    195             floatValueForLength(m_values.at(i + 1), boundingBox.height()) + boundingBox.y()));
     194        path.addLineTo(FloatPoint(floatValueForLength(m_values.at(i), boundingBox.width(), view) + boundingBox.x(),
     195            floatValueForLength(m_values.at(i + 1), boundingBox.height(), view) + boundingBox.y()));
    196196    }
    197197    path.closeSubpath();
     
    221221}
    222222
    223 static FloatSize floatSizeForLengthSize(const LengthSize& lengthSize, const FloatRect& boundingBox)
    224 {
    225     return FloatSize(floatValueForLength(lengthSize.width(), boundingBox.width()),
    226         floatValueForLength(lengthSize.height(), boundingBox.height()));
    227 }
    228 
    229 void BasicShapeInset::path(Path& path, const FloatRect& boundingBox)
    230 {
    231     ASSERT(path.isEmpty());
    232     float left = floatValueForLength(m_left, boundingBox.width());
    233     float top = floatValueForLength(m_top, boundingBox.height());
     223static FloatSize floatSizeForLengthSize(const LengthSize& lengthSize, const FloatRect& boundingBox, RenderView* view)
     224{
     225    return FloatSize(floatValueForLength(lengthSize.width(), boundingBox.width(), view),
     226        floatValueForLength(lengthSize.height(), boundingBox.height(), view));
     227}
     228
     229void BasicShapeInset::path(Path& path, const FloatRect& boundingBox, RenderView* view)
     230{
     231    ASSERT(path.isEmpty());
     232    float left = floatValueForLength(m_left, boundingBox.width(), view);
     233    float top = floatValueForLength(m_top, boundingBox.height(), view);
    234234    FloatRoundedRect r = FloatRoundedRect(
    235235        FloatRect(
    236236            left + boundingBox.x(),
    237237            top + boundingBox.y(),
    238             std::max<float>(boundingBox.width() - left - floatValueForLength(m_right, boundingBox.width()), 0),
    239             std::max<float>(boundingBox.height() - top - floatValueForLength(m_bottom, boundingBox.height()), 0)
     238            std::max<float>(boundingBox.width() - left - floatValueForLength(m_right, boundingBox.width(), view), 0),
     239            std::max<float>(boundingBox.height() - top - floatValueForLength(m_bottom, boundingBox.height(), view), 0)
    240240        ),
    241         floatSizeForLengthSize(m_topLeftRadius, boundingBox),
    242         floatSizeForLengthSize(m_topRightRadius, boundingBox),
    243         floatSizeForLengthSize(m_bottomLeftRadius, boundingBox),
    244         floatSizeForLengthSize(m_bottomRightRadius, boundingBox)
     241        floatSizeForLengthSize(m_topLeftRadius, boundingBox, view),
     242        floatSizeForLengthSize(m_topRightRadius, boundingBox, view),
     243        floatSizeForLengthSize(m_bottomLeftRadius, boundingBox, view),
     244        floatSizeForLengthSize(m_bottomRightRadius, boundingBox, view)
    245245    );
    246246    path.addRoundedRect(r);
  • trunk/Source/WebCore/rendering/style/BasicShapes.h

    r166830 r168481  
    4444class Path;
    4545class RenderBox;
     46class RenderView;
    4647
    4748class BasicShape : public RefCounted<BasicShape> {
     
    5859    bool canBlend(const BasicShape*) const;
    5960
    60     virtual void path(Path&, const FloatRect&) = 0;
     61    virtual void path(Path&, const FloatRect&, RenderView*) = 0;
    6162    virtual WindRule windRule() const { return RULE_NONZERO; }
    6263    virtual PassRefPtr<BasicShape> blend(const BasicShape*, double) const = 0;
     
    152153    const BasicShapeCenterCoordinate& centerY() const { return m_centerY; }
    153154    const BasicShapeRadius& radius() const { return m_radius; }
    154     float floatValueForRadiusInBox(float boxWidth, float boxHeight) const;
     155    float floatValueForRadiusInBox(float boxWidth, float boxHeight, RenderView*) const;
    155156
    156157    void setCenterX(BasicShapeCenterCoordinate centerX) { m_centerX = std::move(centerX); }
     
    158159    void setRadius(BasicShapeRadius radius) { m_radius = std::move(radius); }
    159160
    160     virtual void path(Path&, const FloatRect&) override;
     161    virtual void path(Path&, const FloatRect&, RenderView*) override;
    161162    virtual PassRefPtr<BasicShape> blend(const BasicShape*, double) const override;
    162163
     
    178179    const BasicShapeRadius& radiusX() const { return m_radiusX; }
    179180    const BasicShapeRadius& radiusY() const { return m_radiusY; }
    180     float floatValueForRadiusInBox(const BasicShapeRadius&, float center, float boxWidthOrHeight) const;
     181    float floatValueForRadiusInBox(const BasicShapeRadius&, float center, float boxWidthOrHeight, RenderView*) const;
    181182
    182183    void setCenterX(BasicShapeCenterCoordinate centerX) { m_centerX = std::move(centerX); }
     
    185186    void setRadiusY(BasicShapeRadius radiusY) { m_radiusY = std::move(radiusY); }
    186187
    187     virtual void path(Path&, const FloatRect&) override;
     188    virtual void path(Path&, const FloatRect&, RenderView*) override;
    188189    virtual PassRefPtr<BasicShape> blend(const BasicShape*, double) const override;
    189190
     
    209210    void appendPoint(Length x, Length y) { m_values.append(std::move(x)); m_values.append(std::move(y)); }
    210211
    211     virtual void path(Path&, const FloatRect&) override;
     212    virtual void path(Path&, const FloatRect&, RenderView*) override;
    212213    virtual PassRefPtr<BasicShape> blend(const BasicShape*, double) const override;
    213214
     
    248249    void setBottomLeftRadius(LengthSize radius) { m_bottomLeftRadius = std::move(radius); }
    249250
    250     virtual void path(Path&, const FloatRect&) override;
     251    virtual void path(Path&, const FloatRect&, RenderView*) override;
    251252    virtual PassRefPtr<BasicShape> blend(const BasicShape*, double) const override;
    252253
  • trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp

    r165607 r168481  
    153153        } else
    154154            referenceBox = renderer.objectBoundingBox();
    155         m_paintInfo->context->clipPath(clipPath.pathForReferenceRect(referenceBox), clipPath.windRule());
     155        m_paintInfo->context->clipPath(clipPath.pathForReferenceRect(referenceBox, &renderer.view()), clipPath.windRule());
    156156    }
    157157
Note: See TracChangeset for help on using the changeset viewer.