haikuwebkit/LayoutTests/svg/custom/rect-radius-length-initial.svg

35 lines
1.2 KiB
XML
Raw Permalink Normal View History

Source/WebCore: [SVG2]: Add auto behavior for rx and ry to the SVG <ellipse> and<rect> elements https://bugs.webkit.org/show_bug.cgi?id=199843 Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-09-19 Reviewed by Simon Fraser, Nikolas Zimmermann. The specification is: https://www.w3.org/TR/SVG2/geometry.html#RxProperty. Change the initial value of rx and ry to be "auto". Change the parser to parse LengthOrAuto for these properties. Handle the case if one of them is missing. Tests: svg/custom/ellipse-radius-auto-dynamic.svg svg/custom/ellipse-radius-auto-initial.svg svg/custom/ellipse-radius-length-initial.svg svg/custom/rect-radius-auto-dynamic.svg svg/custom/rect-radius-auto-initial.svg svg/custom/rect-radius-length-initial.svg * css/CSSProperties.json: * css/parser/CSSPropertyParser.cpp: (WebCore::consumeRxOrRy): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialRadius): * rendering/style/SVGRenderStyleDefs.cpp: (WebCore::StyleLayoutData::StyleLayoutData): * rendering/svg/RenderSVGEllipse.cpp: (WebCore::RenderSVGEllipse::calculateRadiiAndCenter): LayoutTests: [SVG2]: Add auto behavior for rx and ry to the SVG <ellipse> and <rect> elements https://bugs.webkit.org/show_bug.cgi?id=199843 Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-09-19 Reviewed by Simon Fraser, Nikolas Zimmermann. Add tests which exercise the initial setting for rx and ry: length, 'auto'. Add tests to dynamically change the values of these properties from length to 'auto'. Skip the tests with dynamic changes till webkit.org/b/201918 is fixed. * TestExpectations: * svg/css/parse-length-expected.txt: * svg/css/parse-length.html: * svg/custom/ellipse-radius-auto-dynamic-expected.svg: Added. * svg/custom/ellipse-radius-auto-dynamic.svg: Added. * svg/custom/ellipse-radius-auto-initial-expected.svg: Added. * svg/custom/ellipse-radius-auto-initial.svg: Added. * svg/custom/ellipse-radius-length-initial-expected.svg: Added. * svg/custom/ellipse-radius-length-initial.svg: Added. * svg/custom/rect-radius-auto-dynamic-expected.svg: Added. * svg/custom/rect-radius-auto-dynamic.svg: Added. * svg/custom/rect-radius-auto-initial-expected.svg: Added. * svg/custom/rect-radius-auto-initial.svg: Added. * svg/custom/rect-radius-length-initial-expected.svg: Added. * svg/custom/rect-radius-length-initial.svg: Added. Canonical link: https://commits.webkit.org/215618@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250103 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-19 20:52:30 +00:00
<svg xmlns="http://www.w3.org/2000/svg">
<style>
#rect-1 { ry: 20px; }
#rect-2 { rx: 30px; }
#rect-3 { ry: 40px; }
#rect-4 { rx: 50px; }
</style>
<rect id="rect-1" x="20" y="40" width="40" height="40" rx="20" fill="green"/>
<rect id="rect-2" x="60" y="30" width="60" height="60" ry="30" fill="green"/>
<rect id="rect-3" x="120" y="20" width="80" height="80" rx="20" fill="green">
<animate attributeType="XML" attributeName="rx" from="20" to="40" dur="1s" fill="freeze"/>
</rect>
<rect id="rect-4" x="200" y="10" width="100" height="100" ry="20" fill="green">
<animate attributeType="XML" attributeName="ry" from="20" to="50" dur="1s" fill="freeze"/>
</rect>
<use y="100" href="#rect-1"/>
<use y="100" href="#rect-2"/>
<use y="100" href="#rect-3"/>
<use y="100" href="#rect-4"/>
<script>
if (window.testRunner)
testRunner.waitUntilDone();
window.addEventListener('load', (event) => {
document.documentElement.setCurrentTime(5);
if (window.testRunner)
testRunner.notifyDone();
});
</script>
</svg>