Commit 13ce54e1 authored by commit-queue@webkit.org's avatar commit-queue@webkit.org
Browse files

Fix SVG animations which set rx or ry attributes

https://bugs.webkit.org/show_bug.cgi?id=127337

Patch by Peter Molnar <pmolnar.u-szeged@partner.samsung.com> on 2014-01-21
Reviewed by Dirk Schulze.

Source/WebCore:

Test: svg/stroke/animated-non-scaling-rxry.html

Merged from Blink: https://src.chromium.org/viewvc/blink?revision=152376&view=revision

* rendering/svg/RenderSVGRect.cpp:
(WebCore::RenderSVGRect::updateShapeFromElement):
* rendering/svg/SVGPathData.cpp:
(WebCore::updatePathFromRectElement):

LayoutTests:

Merged from Blink: https://src.chromium.org/viewvc/blink?revision=152376&view=revision

* svg/stroke/animated-non-scaling-rxry-expected.html: Added.
* svg/stroke/animated-non-scaling-rxry.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1bb1e9c4
2014-01-21 Peter Molnar <pmolnar.u-szeged@partner.samsung.com>
Fix SVG animations which set rx or ry attributes
https://bugs.webkit.org/show_bug.cgi?id=127337
Reviewed by Dirk Schulze.
Merged from Blink: https://src.chromium.org/viewvc/blink?revision=152376&view=revision
* svg/stroke/animated-non-scaling-rxry-expected.html: Added.
* svg/stroke/animated-non-scaling-rxry.html: Added.
2014-01-21 Krzysztof Czech <k.czech@samsung.com>
 
[ATK] Expose aria-flowto through ATK_RELATION_FLOWS_TO
<!DOCTYPE html>
<html>
<body>
Test for crbug.com/235256: this test passes if the rect is rounded<br>
<svg width="300" height="300">
<rect x="20" y="20" width="200" height="200" fill="green" rx="50" ry="20"></rect>
</svg>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
Test for crbug.com/235256: this test passes if the rect is rounded<br>
<svg width="300" height="300">
<rect x="20" y="20" width="200" height="200" fill="green">
<set attributename="rx" to="50" begin="0s" fill="freeze"/>
<set attributename="ry" to="20" begin="0s" fill="freeze"/>
</rect>
</svg>
</body>
</html>
2014-01-21 Peter Molnar <pmolnar.u-szeged@partner.samsung.com>
Fix SVG animations which set rx or ry attributes
https://bugs.webkit.org/show_bug.cgi?id=127337
Reviewed by Dirk Schulze.
Test: svg/stroke/animated-non-scaling-rxry.html
Merged from Blink: https://src.chromium.org/viewvc/blink?revision=152376&view=revision
* rendering/svg/RenderSVGRect.cpp:
(WebCore::RenderSVGRect::updateShapeFromElement):
* rendering/svg/SVGPathData.cpp:
(WebCore::updatePathFromRectElement):
2014-01-21 Krzysztof Czech <k.czech@samsung.com>
 
[ATK] Expose aria-flowto through ATK_RELATION_FLOWS_TO
......@@ -57,15 +57,15 @@ void RenderSVGRect::updateShapeFromElement()
m_innerStrokeRect = FloatRect();
m_outerStrokeRect = FloatRect();
SVGLengthContext lengthContext(&rectElement());
// Fallback to RenderSVGShape if rect has rounded corners or a non-scaling stroke.
if (rectElement().hasAttribute(SVGNames::rxAttr) || rectElement().hasAttribute(SVGNames::ryAttr) || hasNonScalingStroke()) {
if (rectElement().rx().value(lengthContext) > 0 || rectElement().ry().value(lengthContext) > 0 || hasNonScalingStroke()) {
RenderSVGShape::updateShapeFromElement();
m_usePathFallback = true;
return;
} else
m_usePathFallback = false;
}
SVGLengthContext lengthContext(&rectElement());
m_usePathFallback = false;
FloatSize boundingBoxSize(rectElement().width().value(lengthContext), rectElement().height().value(lengthContext));
if (boundingBoxSize.isEmpty())
return;
......
......@@ -115,8 +115,8 @@ static void updatePathFromRectElement(SVGElement* element, Path& path)
return;
float x = rect->x().value(lengthContext);
float y = rect->y().value(lengthContext);
bool hasRx = rect->hasAttribute(SVGNames::rxAttr);
bool hasRy = rect->hasAttribute(SVGNames::ryAttr);
bool hasRx = rect->rx().value(lengthContext) > 0;
bool hasRy = rect->ry().value(lengthContext) > 0;
if (hasRx || hasRy) {
float rx = rect->rx().value(lengthContext);
float ry = rect->ry().value(lengthContext);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment