Diff
Modified: trunk/LayoutTests/ChangeLog (172641 => 172642)
--- trunk/LayoutTests/ChangeLog 2014-08-15 19:38:10 UTC (rev 172641)
+++ trunk/LayoutTests/ChangeLog 2014-08-15 19:42:38 UTC (rev 172642)
@@ -1,5 +1,21 @@
2014-08-15 Dirk Schulze <[email protected]>
+ Turn r/rx/ry to presentation attributes
+ https://bugs.webkit.org/show_bug.cgi?id=135978
+
+ Reviewed by Dean Jackson.
+
+ This follows the patch for width and height presentation attributes and
+ turns r, rx and ry to presentation attributes as well:
+
+ http://trac.webkit.org/changeset/171341
+
+ * svg/css/parse-length.html:
+ * transitions/svg-layout-transition-expected.txt:
+ * transitions/svg-layout-transition.html:
+
+2014-08-15 Dirk Schulze <[email protected]>
+
Turn cx/cy to presentation attributes
https://bugs.webkit.org/show_bug.cgi?id=135975
Modified: trunk/LayoutTests/svg/css/parse-length.html (172641 => 172642)
--- trunk/LayoutTests/svg/css/parse-length.html 2014-08-15 19:38:10 UTC (rev 172641)
+++ trunk/LayoutTests/svg/css/parse-length.html 2014-08-15 19:42:38 UTC (rev 172642)
@@ -50,6 +50,33 @@
testComputed("cy", "20%", "20%");
testComputed("cy", "-200px", "-200px");
+// Test 'r'.
+testComputed("r", " 100", "100px");
+testComputed("r", "100 ", "100px");
+testComputed("r", "100px", "100px");
+testComputed("r", "1em", "16px");
+testComputed("r", "1ex", "12.800000190734863px");
+testComputed("r", "20%", "20%");
+testComputed("r", "-200px", "-200px");
+
+// Test 'rx'.
+testComputed("rx", " 100", "100px");
+testComputed("rx", "100 ", "100px");
+testComputed("rx", "100px", "100px");
+testComputed("rx", "1em", "16px");
+testComputed("rx", "1ex", "12.800000190734863px");
+testComputed("rx", "20%", "20%");
+testComputed("rx", "-200px", "-200px");
+
+// Test 'ry'.
+testComputed("ry", " 100", "100px");
+testComputed("ry", "100 ", "100px");
+testComputed("ry", "100px", "100px");
+testComputed("ry", "1em", "16px");
+testComputed("ry", "1ex", "12.800000190734863px");
+testComputed("ry", "20%", "20%");
+testComputed("ry", "-200px", "-200px");
+
// Test 'width'.
testComputed("width", "auto", "auto");
testComputed("width", " 100", "100px");
@@ -94,6 +121,27 @@
negativeTestZero("cy", "100px !important");
negativeTestZero("cy", "{ 100px }");
+// Negative tests for 'r'.
+negativeTestZero("r", "auto", "auto");
+negativeTestZero("r", "100 px");
+negativeTestZero("r", "100px;");
+negativeTestZero("r", "100px !important");
+negativeTestZero("r", "{ 100px }");
+
+// Negative tests for 'rx'.
+negativeTestZero("rx", "auto", "auto");
+negativeTestZero("rx", "100 px");
+negativeTestZero("rx", "100px;");
+negativeTestZero("rx", "100px !important");
+negativeTestZero("rx", "{ 100px }");
+
+// Negative tests for 'ry'.
+negativeTestZero("ry", "auto");
+negativeTestZero("ry", "100 px");
+negativeTestZero("ry", "100px;");
+negativeTestZero("ry", "100px !important");
+negativeTestZero("ry", "{ 100px }");
+
// Negative tests for 'width'.
negativeTest("width", "100 px");
negativeTest("width", "100px;");
Modified: trunk/LayoutTests/transitions/svg-layout-transition-expected.txt (172641 => 172642)
--- trunk/LayoutTests/transitions/svg-layout-transition-expected.txt 2014-08-15 19:38:10 UTC (rev 172641)
+++ trunk/LayoutTests/transitions/svg-layout-transition-expected.txt 2014-08-15 19:42:38 UTC (rev 172642)
@@ -1,5 +1,8 @@
PASS - "cx" property for "cx" element at 0.5s saw something close to: 150
PASS - "cy" property for "cy" element at 0.5s saw something close to: 150
+PASS - "r" property for "r" element at 0.5s saw something close to: 150
+PASS - "rx" property for "rx" element at 0.5s saw something close to: 150
+PASS - "ry" property for "ry" element at 0.5s saw something close to: 150
PASS - "x" property for "x" element at 0.5s saw something close to: 150
PASS - "y" property for "y" element at 0.5s saw something close to: 150
PASS - "width" property for "width" element at 0.5s saw something close to: 150
Modified: trunk/LayoutTests/transitions/svg-layout-transition.html (172641 => 172642)
--- trunk/LayoutTests/transitions/svg-layout-transition.html 2014-08-15 19:38:10 UTC (rev 172641)
+++ trunk/LayoutTests/transitions/svg-layout-transition.html 2014-08-15 19:42:38 UTC (rev 172642)
@@ -21,7 +21,28 @@
#cy.final {
cy: 200px;
}
-
+
+ #r {
+ -webkit-transition-property: r;
+ }
+ #r.final {
+ r: 200px;
+ }
+
+ #rx {
+ -webkit-transition-property: rx;
+ }
+ #rx.final {
+ rx: 200px;
+ }
+
+ #ry {
+ -webkit-transition-property: ry;
+ }
+ #ry.final {
+ ry: 200px;
+ }
+
#x {
-webkit-transition-property: x;
}
@@ -58,6 +79,9 @@
// [time, element-id, property, expected-value, tolerance]
[0.5, 'cx', 'cx', 150, 20],
[0.5, 'cy', 'cy', 150, 20],
+ [0.5, 'r', 'r', 150, 20],
+ [0.5, 'rx', 'rx', 150, 20],
+ [0.5, 'ry', 'ry', 150, 20],
[0.5, 'x', 'x', 150, 20],
[0.5, 'y', 'y', 150, 20],
[0.5, 'width', 'width', 150, 20],
@@ -68,6 +92,9 @@
{
document.getElementById('cx').setAttribute('class', 'init final');
document.getElementById('cy').setAttribute('class', 'init final');
+ document.getElementById('r').setAttribute('class', 'init final');
+ document.getElementById('rx').setAttribute('class', 'init final');
+ document.getElementById('ry').setAttribute('class', 'init final');
document.getElementById('x').setAttribute('class', 'init final');
document.getElementById('y').setAttribute('class', 'init final');
document.getElementById('width').setAttribute('class', 'init final');
@@ -81,6 +108,9 @@
<svg>
<circle cx="100" cy="100" r="100" class="init" id="cx"/>
<circle cx="100" cy="100" r="100" class="init" id="cy"/>
+ <circle cx="100" cy="100" r="100" class="init" id="r"/>
+ <ellipse cx="100" cy="100" rx="100" ry="100" class="init" id="rx"/>
+ <ellipse cx="100" cy="100" rx="100" ry="100" class="init" id="ry"/>
<rect x="100" y="100" width="100" height="100" class="init" id="x"/>
<rect x="100" y="100" width="100" height="100" class="init" id="y"/>
<rect x="100" y="100" width="100" height="100" class="init" id="width"/>
Modified: trunk/Source/WebCore/ChangeLog (172641 => 172642)
--- trunk/Source/WebCore/ChangeLog 2014-08-15 19:38:10 UTC (rev 172641)
+++ trunk/Source/WebCore/ChangeLog 2014-08-15 19:42:38 UTC (rev 172642)
@@ -1,5 +1,59 @@
2014-08-15 Dirk Schulze <[email protected]>
+ Turn r/rx/ry to presentation attributes
+ https://bugs.webkit.org/show_bug.cgi?id=135978
+
+ Reviewed by Dean Jackson.
+
+ This follows the patch for width and height presentation attributes and
+ turns rx, ry and r to presentation attributes as well:
+
+ http://trac.webkit.org/changeset/171341
+
+ Extended existing tests.
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::ComputedStyleExtractor::propertyValue):
+ * css/CSSParser.cpp:
+ (WebCore::isSimpleLengthPropertyID):
+ * css/DeprecatedStyleBuilder.cpp:
+ (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
+ * css/SVGCSSParser.cpp:
+ (WebCore::CSSParser::parseSVGValue):
+ * css/SVGCSSPropertyNames.in:
+ * page/animation/CSSPropertyAnimation.cpp:
+ (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
+ * rendering/style/RenderStyle.h:
+ * rendering/style/SVGRenderStyle.h:
+ (WebCore::SVGRenderStyle::setR):
+ (WebCore::SVGRenderStyle::setRx):
+ (WebCore::SVGRenderStyle::setRy):
+ (WebCore::SVGRenderStyle::r):
+ (WebCore::SVGRenderStyle::rx):
+ (WebCore::SVGRenderStyle::ry):
+ * rendering/style/SVGRenderStyleDefs.cpp:
+ (WebCore::StyleLayoutData::StyleLayoutData):
+ (WebCore::StyleLayoutData::operator==):
+ * rendering/style/SVGRenderStyleDefs.h:
+ * rendering/svg/RenderSVGEllipse.cpp:
+ (WebCore::RenderSVGEllipse::calculateRadiiAndCenter):
+ * rendering/svg/SVGPathData.cpp:
+ (WebCore::updatePathFromCircleElement):
+ (WebCore::updatePathFromEllipseElement):
+ (WebCore::updatePathFromRectElement):
+ (WebCore::updatePathFromLineElement): Deleted.
+ * svg/SVGCircleElement.cpp:
+ (WebCore::SVGCircleElement::svgAttributeChanged):
+ * svg/SVGElement.cpp:
+ (WebCore::populateAttributeNameToCSSPropertyIDMap):
+ (WebCore::populateCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap):
+ * svg/SVGEllipseElement.cpp:
+ (WebCore::SVGEllipseElement::svgAttributeChanged):
+ * svg/SVGRectElement.cpp:
+ (WebCore::SVGRectElement::svgAttributeChanged):
+
+2014-08-15 Dirk Schulze <[email protected]>
+
Turn cx/cy to presentation attributes
https://bugs.webkit.org/show_bug.cgi?id=135975
Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (172641 => 172642)
--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2014-08-15 19:38:10 UTC (rev 172641)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2014-08-15 19:42:38 UTC (rev 172642)
@@ -424,6 +424,9 @@
CSSPropertyMarkerStart,
CSSPropertyMaskType,
CSSPropertyPaintOrder,
+ CSSPropertyR,
+ CSSPropertyRx,
+ CSSPropertyRy,
CSSPropertyShapeRendering,
CSSPropertyStroke,
CSSPropertyStrokeDasharray,
@@ -2972,6 +2975,12 @@
return zoomAdjustedPixelValueForLength(style->svgStyle().cx(), style.get());
case CSSPropertyCy:
return zoomAdjustedPixelValueForLength(style->svgStyle().cy(), style.get());
+ case CSSPropertyR:
+ return zoomAdjustedPixelValueForLength(style->svgStyle().r(), style.get());
+ case CSSPropertyRx:
+ return zoomAdjustedPixelValueForLength(style->svgStyle().rx(), style.get());
+ case CSSPropertyRy:
+ return zoomAdjustedPixelValueForLength(style->svgStyle().ry(), style.get());
case CSSPropertyX:
return zoomAdjustedPixelValueForLength(style->svgStyle().x(), style.get());
case CSSPropertyY:
Modified: trunk/Source/WebCore/css/CSSParser.cpp (172641 => 172642)
--- trunk/Source/WebCore/css/CSSParser.cpp 2014-08-15 19:38:10 UTC (rev 172641)
+++ trunk/Source/WebCore/css/CSSParser.cpp 2014-08-15 19:42:38 UTC (rev 172642)
@@ -569,6 +569,9 @@
case CSSPropertyMarginLeft:
case CSSPropertyMarginRight:
case CSSPropertyMarginTop:
+ case CSSPropertyR:
+ case CSSPropertyRx:
+ case CSSPropertyRy:
case CSSPropertyRight:
case CSSPropertyTop:
case CSSPropertyWebkitMarginAfter:
Modified: trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp (172641 => 172642)
--- trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp 2014-08-15 19:38:10 UTC (rev 172641)
+++ trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp 2014-08-15 19:42:38 UTC (rev 172642)
@@ -2596,6 +2596,9 @@
setPropertyHandler(CSSPropertyCx, ApplyPropertyLength<&RenderStyle::cx, &RenderStyle::setCx, &RenderStyle::initialZeroLength>::createHandler());
setPropertyHandler(CSSPropertyCy, ApplyPropertyLength<&RenderStyle::cy, &RenderStyle::setCy, &RenderStyle::initialZeroLength>::createHandler());
+ setPropertyHandler(CSSPropertyR, ApplyPropertyLength<&RenderStyle::r, &RenderStyle::setR, &RenderStyle::initialZeroLength>::createHandler());
+ setPropertyHandler(CSSPropertyRx, ApplyPropertyLength<&RenderStyle::rx, &RenderStyle::setRx, &RenderStyle::initialZeroLength>::createHandler());
+ setPropertyHandler(CSSPropertyRy, ApplyPropertyLength<&RenderStyle::ry, &RenderStyle::setRy, &RenderStyle::initialZeroLength>::createHandler());
setPropertyHandler(CSSPropertyX, ApplyPropertyLength<&RenderStyle::x, &RenderStyle::setX, &RenderStyle::initialZeroLength>::createHandler());
setPropertyHandler(CSSPropertyY, ApplyPropertyLength<&RenderStyle::y, &RenderStyle::setY, &RenderStyle::initialZeroLength>::createHandler());
Modified: trunk/Source/WebCore/css/SVGCSSParser.cpp (172641 => 172642)
--- trunk/Source/WebCore/css/SVGCSSParser.cpp 2014-08-15 19:38:10 UTC (rev 172641)
+++ trunk/Source/WebCore/css/SVGCSSParser.cpp 2014-08-15 19:42:38 UTC (rev 172642)
@@ -301,6 +301,9 @@
}
case CSSPropertyCx:
case CSSPropertyCy:
+ case CSSPropertyR:
+ case CSSPropertyRx:
+ case CSSPropertyRy:
case CSSPropertyX:
case CSSPropertyY:
valid_primitive = (!id && validUnit(value, FLength | FPercent));
Modified: trunk/Source/WebCore/css/SVGCSSPropertyNames.in (172641 => 172642)
--- trunk/Source/WebCore/css/SVGCSSPropertyNames.in 2014-08-15 19:38:10 UTC (rev 172641)
+++ trunk/Source/WebCore/css/SVGCSSPropertyNames.in 2014-08-15 19:42:38 UTC (rev 172642)
@@ -54,6 +54,9 @@
cx
cy
+r
+rx
+ry
x
y
Modified: trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp (172641 => 172642)
--- trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp 2014-08-15 19:38:10 UTC (rev 172641)
+++ trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp 2014-08-15 19:42:38 UTC (rev 172642)
@@ -1258,6 +1258,9 @@
new LengthPropertyWrapper<Length>(CSSPropertyCx, &RenderStyle::cx, &RenderStyle::setCx),
new LengthPropertyWrapper<Length>(CSSPropertyCy, &RenderStyle::cy, &RenderStyle::setCy),
+ new LengthPropertyWrapper<Length>(CSSPropertyR, &RenderStyle::r, &RenderStyle::setR),
+ new LengthPropertyWrapper<Length>(CSSPropertyRx, &RenderStyle::rx, &RenderStyle::setRx),
+ new LengthPropertyWrapper<Length>(CSSPropertyRy, &RenderStyle::ry, &RenderStyle::setRy),
new LengthPropertyWrapper<Length>(CSSPropertyX, &RenderStyle::x, &RenderStyle::setX),
new LengthPropertyWrapper<Length>(CSSPropertyY, &RenderStyle::y, &RenderStyle::setY),
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (172641 => 172642)
--- trunk/Source/WebCore/rendering/style/RenderStyle.h 2014-08-15 19:38:10 UTC (rev 172641)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h 2014-08-15 19:42:38 UTC (rev 172642)
@@ -1669,6 +1669,12 @@
void setCx(Length cx) { accessSVGStyle().setCx(cx); }
const Length& cy() const { return svgStyle().cy(); }
void setCy(Length cy) { accessSVGStyle().setCy(cy); }
+ const Length& r() const { return svgStyle().r(); }
+ void setR(Length r) { accessSVGStyle().setR(r); }
+ const Length& rx() const { return svgStyle().rx(); }
+ void setRx(Length rx) { accessSVGStyle().setRx(rx); }
+ const Length& ry() const { return svgStyle().ry(); }
+ void setRy(Length ry) { accessSVGStyle().setRy(ry); }
const Length& x() const { return svgStyle().x(); }
void setX(Length x) { accessSVGStyle().setX(x); }
const Length& y() const { return svgStyle().y(); }
Modified: trunk/Source/WebCore/rendering/style/SVGRenderStyle.h (172641 => 172642)
--- trunk/Source/WebCore/rendering/style/SVGRenderStyle.h 2014-08-15 19:38:10 UTC (rev 172641)
+++ trunk/Source/WebCore/rendering/style/SVGRenderStyle.h 2014-08-15 19:42:38 UTC (rev 172642)
@@ -156,6 +156,21 @@
if (!(layout->cy == obj))
layout.access()->cy = obj;
}
+ void setR(const Length& obj)
+ {
+ if (!(layout->r == obj))
+ layout.access()->r = obj;
+ }
+ void setRx(const Length& obj)
+ {
+ if (!(layout->rx == obj))
+ layout.access()->rx = obj;
+ }
+ void setRy(const Length& obj)
+ {
+ if (!(layout->ry == obj))
+ layout.access()->ry = obj;
+ }
void setX(const Length& obj)
{
if (!(layout->x == obj))
@@ -365,6 +380,9 @@
ShadowData* shadow() const { return shadowSVG->shadow.get(); }
const Length& cx() const { return layout->cx; }
const Length& cy() const { return layout->cy; }
+ const Length& r() const { return layout->r; }
+ const Length& rx() const { return layout->rx; }
+ const Length& ry() const { return layout->ry; }
const Length& x() const { return layout->x; }
const Length& y() const { return layout->y; }
String clipperResource() const { return resources->clipper; }
Modified: trunk/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp (172641 => 172642)
--- trunk/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp 2014-08-15 19:38:10 UTC (rev 172641)
+++ trunk/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp 2014-08-15 19:42:38 UTC (rev 172642)
@@ -280,6 +280,9 @@
StyleLayoutData::StyleLayoutData()
: cx(RenderStyle::initialZeroLength())
, cy(RenderStyle::initialZeroLength())
+ , r(RenderStyle::initialZeroLength())
+ , rx(RenderStyle::initialZeroLength())
+ , ry(RenderStyle::initialZeroLength())
, x(RenderStyle::initialZeroLength())
, y(RenderStyle::initialZeroLength())
{
@@ -289,6 +292,9 @@
: RefCounted<StyleLayoutData>()
, cx(other.cx)
, cy(other.cy)
+ , r(other.r)
+ , rx(other.rx)
+ , ry(other.ry)
, x(other.x)
, y(other.y)
{
@@ -303,6 +309,9 @@
{
return cx == other.cx
&& cy == other.cy
+ && r == other.r
+ && rx == other.rx
+ && ry == other.ry
&& x == other.x
&& y == other.y;
}
Modified: trunk/Source/WebCore/rendering/style/SVGRenderStyleDefs.h (172641 => 172642)
--- trunk/Source/WebCore/rendering/style/SVGRenderStyleDefs.h 2014-08-15 19:38:10 UTC (rev 172641)
+++ trunk/Source/WebCore/rendering/style/SVGRenderStyleDefs.h 2014-08-15 19:42:38 UTC (rev 172642)
@@ -304,6 +304,9 @@
Length cx;
Length cy;
+ Length r;
+ Length rx;
+ Length ry;
Length x;
Length y;
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGEllipse.cpp (172641 => 172642)
--- trunk/Source/WebCore/rendering/svg/RenderSVGEllipse.cpp 2014-08-15 19:38:10 UTC (rev 172641)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGEllipse.cpp 2014-08-15 19:42:38 UTC (rev 172642)
@@ -82,16 +82,13 @@
lengthContext.valueForLength(style().svgStyle().cx(), LengthModeWidth),
lengthContext.valueForLength(style().svgStyle().cy(), LengthModeHeight));
if (isSVGCircleElement(graphicsElement())) {
- SVGCircleElement& circle = toSVGCircleElement(graphicsElement());
- SVGLengthContext lengthContext(&circle);
- float radius = circle.r().value(lengthContext);
+ float radius = lengthContext.valueForLength(style().svgStyle().r());
m_radii = FloatSize(radius, radius);
return;
}
ASSERT(isSVGEllipseElement(graphicsElement()));
- SVGEllipseElement& ellipse = toSVGEllipseElement(graphicsElement());
- m_radii = FloatSize(ellipse.rx().value(lengthContext), ellipse.ry().value(lengthContext));
+ m_radii = FloatSize(lengthContext.valueForLength(style().svgStyle().rx()), lengthContext.valueForLength(style().svgStyle().ry()));
}
void RenderSVGEllipse::fillShape(GraphicsContext* context) const
Modified: trunk/Source/WebCore/rendering/svg/SVGPathData.cpp (172641 => 172642)
--- trunk/Source/WebCore/rendering/svg/SVGPathData.cpp 2014-08-15 19:38:10 UTC (rev 172641)
+++ trunk/Source/WebCore/rendering/svg/SVGPathData.cpp 2014-08-15 19:42:38 UTC (rev 172642)
@@ -40,15 +40,14 @@
static void updatePathFromCircleElement(SVGElement* element, Path& path)
{
ASSERT(isSVGCircleElement(element));
- SVGCircleElement* circle = toSVGCircleElement(element);
SVGLengthContext lengthContext(element);
- float r = circle->r().value(lengthContext);
+ RenderElement* renderer = element->renderer();
+ if (!renderer)
+ return;
+ RenderStyle& style = renderer->style();
+ float r = lengthContext.valueForLength(style.svgStyle().r());
if (r > 0) {
- RenderElement* renderer = circle->renderer();
- if (!renderer)
- return;
- RenderStyle& style = renderer->style();
float cx = lengthContext.valueForLength(style.svgStyle().cx(), LengthModeWidth);
float cy = lengthContext.valueForLength(style.svgStyle().cy(), LengthModeHeight);
path.addEllipse(FloatRect(cx - r, cy - r, r * 2, r * 2));
@@ -57,19 +56,17 @@
static void updatePathFromEllipseElement(SVGElement* element, Path& path)
{
- SVGEllipseElement* ellipse = toSVGEllipseElement(element);
-
+ RenderElement* renderer = element->renderer();
+ if (!renderer)
+ return;
+ RenderStyle& style = renderer->style();
SVGLengthContext lengthContext(element);
- float rx = ellipse->rx().value(lengthContext);
+ float rx = lengthContext.valueForLength(style.svgStyle().rx(), LengthModeWidth);
if (rx <= 0)
return;
- float ry = ellipse->ry().value(lengthContext);
+ float ry = lengthContext.valueForLength(style.svgStyle().ry(), LengthModeHeight);
if (ry <= 0)
return;
- RenderElement* renderer = ellipse->renderer();
- if (!renderer)
- return;
- RenderStyle& style = renderer->style();
float cx = lengthContext.valueForLength(style.svgStyle().cx(), LengthModeWidth);
float cy = lengthContext.valueForLength(style.svgStyle().cy(), LengthModeHeight);
path.addEllipse(FloatRect(cx - rx, cy - ry, rx * 2, ry * 2));
@@ -119,8 +116,7 @@
static void updatePathFromRectElement(SVGElement* element, Path& path)
{
- SVGRectElement* rect = toSVGRectElement(element);
- RenderElement* renderer = rect->renderer();
+ RenderElement* renderer = element->renderer();
if (!renderer)
return;
@@ -134,8 +130,8 @@
return;
float x = lengthContext.valueForLength(style.svgStyle().x(), LengthModeWidth);
float y = lengthContext.valueForLength(style.svgStyle().y(), LengthModeHeight);
- float rx = rect->rx().value(lengthContext);
- float ry = rect->ry().value(lengthContext);
+ float rx = lengthContext.valueForLength(style.svgStyle().rx(), LengthModeWidth);
+ float ry = lengthContext.valueForLength(style.svgStyle().ry(), LengthModeHeight);
bool hasRx = rx > 0;
bool hasRy = ry > 0;
if (hasRx || hasRy) {
Modified: trunk/Source/WebCore/svg/SVGCircleElement.cpp (172641 => 172642)
--- trunk/Source/WebCore/svg/SVGCircleElement.cpp 2014-08-15 19:38:10 UTC (rev 172641)
+++ trunk/Source/WebCore/svg/SVGCircleElement.cpp 2014-08-15 19:42:38 UTC (rev 172642)
@@ -107,24 +107,16 @@
SVGElementInstance::InvalidationGuard invalidationGuard(this);
if (attrName == SVGNames::cxAttr
- || attrName == SVGNames::cyAttr) {
+ || attrName == SVGNames::cyAttr
+ || attrName == SVGNames::rAttr) {
invalidateSVGPresentationAttributeStyle();
return;
}
- if (attrName == SVGNames::rAttr)
- updateRelativeLengthsInformation();
-
RenderSVGShape* renderer = toRenderSVGShape(this->renderer());
if (!renderer)
return;
- if (attrName == SVGNames::rAttr) {
- renderer->setNeedsShapeUpdate();
- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
- return;
- }
-
if (SVGLangSpace::isKnownAttribute(attrName) || SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
return;
Modified: trunk/Source/WebCore/svg/SVGElement.cpp (172641 => 172642)
--- trunk/Source/WebCore/svg/SVGElement.cpp 2014-08-15 19:38:10 UTC (rev 172641)
+++ trunk/Source/WebCore/svg/SVGElement.cpp 2014-08-15 19:42:38 UTC (rev 172642)
@@ -126,6 +126,9 @@
&overflowAttr,
&paint_orderAttr,
&pointer_eventsAttr,
+ &rAttr,
+ &rxAttr,
+ &ryAttr,
&shape_renderingAttr,
&stop_colorAttr,
&stop_opacityAttr,
@@ -248,6 +251,9 @@
static const TableEntry table[] = {
{ cxAttr, AnimatedLength },
{ cyAttr, AnimatedLength },
+ { rAttr, AnimatedLength },
+ { rxAttr, AnimatedLength },
+ { ryAttr, AnimatedLength },
{ SVGNames::heightAttr, AnimatedLength },
{ SVGNames::widthAttr, AnimatedLength },
{ xAttr, AnimatedLength },
Modified: trunk/Source/WebCore/svg/SVGEllipseElement.cpp (172641 => 172642)
--- trunk/Source/WebCore/svg/SVGEllipseElement.cpp 2014-08-15 19:38:10 UTC (rev 172641)
+++ trunk/Source/WebCore/svg/SVGEllipseElement.cpp 2014-08-15 19:42:38 UTC (rev 172642)
@@ -111,27 +111,17 @@
SVGElementInstance::InvalidationGuard invalidationGuard(this);
if (attrName == SVGNames::cxAttr
- || attrName == SVGNames::cyAttr) {
+ || attrName == SVGNames::cyAttr
+ || attrName == SVGNames::rxAttr
+ || attrName == SVGNames::ryAttr) {
invalidateSVGPresentationAttributeStyle();
return;
}
- bool isLengthAttribute = attrName == SVGNames::rxAttr
- || attrName == SVGNames::ryAttr;
-
- if (isLengthAttribute)
- updateRelativeLengthsInformation();
-
RenderSVGShape* renderer = toRenderSVGShape(this->renderer());
if (!renderer)
return;
- if (isLengthAttribute) {
- renderer->setNeedsShapeUpdate();
- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
- return;
- }
-
if (SVGLangSpace::isKnownAttribute(attrName) || SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
return;
Modified: trunk/Source/WebCore/svg/SVGRectElement.cpp (172641 => 172642)
--- trunk/Source/WebCore/svg/SVGRectElement.cpp 2014-08-15 19:38:10 UTC (rev 172641)
+++ trunk/Source/WebCore/svg/SVGRectElement.cpp 2014-08-15 19:42:38 UTC (rev 172642)
@@ -125,27 +125,17 @@
if (attrName == SVGNames::xAttr
|| attrName == SVGNames::yAttr
|| attrName == SVGNames::widthAttr
- || attrName == SVGNames::heightAttr) {
+ || attrName == SVGNames::heightAttr
+ || attrName == SVGNames::rxAttr
+ || attrName == SVGNames::ryAttr) {
invalidateSVGPresentationAttributeStyle();
return;
}
- bool isLengthAttribute = attrName == SVGNames::rxAttr
- || attrName == SVGNames::ryAttr;
-
- if (isLengthAttribute)
- updateRelativeLengthsInformation();
-
RenderSVGShape* renderer = toRenderSVGShape(this->renderer());
if (!renderer)
return;
- if (isLengthAttribute) {
- renderer->setNeedsShapeUpdate();
- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
- return;
- }
-
if (SVGLangSpace::isKnownAttribute(attrName) || SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
return;