haikuwebkit/LayoutTests/svg/custom/svgsvgelement-ctm2.xhtml

18 lines
754 B
HTML
Raw Permalink Normal View History

2010-03-31 Nikolas Zimmermann <nzimmermann@rim.com> Reviewed by Dirk Schulze. REGRESSION: document.documentElement.getScreenCTM() returns incorrect matrix. https://bugs.webkit.org/show_bug.cgi?id=27183 Rewrite getCTM() / getScreenCTM() handling in an iterative way, fixing all known problems/limitations. The bug mentioned above is actually not a regression, getScreenCTM() only worked before, because we did not handle non-SVG CSS box parents properly. When support was added to handle those cases, the getScreenCTM() handling was completly off, causing a lot of trouble in real-life SVG applications (carto.net for instance) Tests: svg/custom/svgsvgelement-ctm.xhtml (fixed typo, missing unit identifier in CSS 'height' property, leading to incorrect results) svg/custom/svgsvgelement-ctm2.xhtml svg/custom/svgsvgelement-ctm3.xhtml svg/custom/svgsvgelement-ctm4.xhtml svg/custom/svgsvgelement-ctm5.xhtml * svg/SVGLocatable.cpp: (WebCore::SVGLocatable::getBBox): (WebCore::SVGLocatable::computeCTM): * svg/SVGLocatable.h: (WebCore::SVGLocatable::localCoordinateSpaceTransform): * svg/SVGSVGElement.cpp: (WebCore::SVGSVGElement::localCoordinateSpaceTransform): (WebCore::SVGSVGElement::createRenderer): * svg/SVGSVGElement.h: * svg/SVGStyledElement.cpp: (WebCore::SVGStyledElement::localCoordinateSpaceTransform): * svg/SVGStyledElement.h: * svg/SVGStyledLocatableElement.cpp: (WebCore::SVGStyledLocatableElement::getCTM): (WebCore::SVGStyledLocatableElement::getScreenCTM): * svg/SVGStyledLocatableElement.h: (WebCore::SVGStyledLocatableElement::localCoordinateSpaceTransform): * svg/SVGStyledTransformableElement.cpp: (WebCore::SVGStyledTransformableElement::getCTM): (WebCore::SVGStyledTransformableElement::getScreenCTM): * svg/SVGStyledTransformableElement.h: (WebCore::SVGStyledTransformableElement::localCoordinateSpaceTransform): * svg/SVGTextElement.cpp: (WebCore::SVGTextElement::getCTM): (WebCore::SVGTextElement::getScreenCTM): * svg/SVGTextElement.h: (WebCore::SVGTextElement::localCoordinateSpaceTransform): * svg/SVGTransformable.cpp: (WebCore::SVGTransformable::SVGTransformable): * svg/SVGTransformable.h: (WebCore::SVGTransformable::localCoordinateSpaceTransform): 2010-03-31 Nikolas Zimmermann <nzimmermann@rim.com> Reviewed by Dirk Schulze. REGRESSION: document.documentElement.getScreenCTM() returns incorrect matrix. https://bugs.webkit.org/show_bug.cgi?id=27183 Share code between the different svgsvgelement-ctm*.xhtm tests, placed in svg/custom/resources. Add several new tests covering getCTM()/getScreenCTM() on text, inner and outer svg elements and containers. * svg/custom/resources/svgsvgelement-ctm.js: Added. (log): (stringForMatrix): (printCTMs): * svg/custom/svgsvgelement-ctm-expected.txt: * svg/custom/svgsvgelement-ctm.xhtml: * svg/custom/svgsvgelement-ctm2-expected.txt: Added. * svg/custom/svgsvgelement-ctm2.xhtml: Added. * svg/custom/svgsvgelement-ctm3-expected.txt: Added. * svg/custom/svgsvgelement-ctm3.xhtml: Added. * svg/custom/svgsvgelement-ctm4-expected.txt: Added. * svg/custom/svgsvgelement-ctm4.xhtml: Added. * svg/custom/svgsvgelement-ctm5-expected.txt: Added. * svg/custom/svgsvgelement-ctm5.xhtml: Added. Canonical link: https://commits.webkit.org/48198@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@56905 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-04-01 08:30:19 +00:00
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<div>
<!-- All values should be identical to svgsvgelement-ctm.xhtml, except the screenCTM e/f values, our values should be 2px smaller here (108 instead of 110 etc..) -->
<!-- svgsvgelement-ctm.xhtml assigns a top/left position of 10px, and here 8px offset is automatically assigned from the parent <body> -->
<svg xmlns="http://www.w3.org/2000/svg" id="svg1" width="400" height="400">
<svg id="svg2" viewBox="5 5 20 20">
<g id="group" transform="translate(10, 10)">
<svg id="svg3" viewBox="5 5 20 20"></svg>
</g>
</svg>
</svg>
</div>
<div id="log"></div>
<script src="resources/svgsvgelement-ctm.js"></script>
</body>
</html>