haikuwebkit/LayoutTests/svg/transforms/change-transform-origin-css...

6 lines
182 B
HTML
Raw Permalink Normal View History

SVG should support transform-origin and relative values https://bugs.webkit.org/show_bug.cgi?id=79068 Patch by Hans Muller <hmuller@adobe.com> on 2012-03-12 Reviewed by Dirk Schulze. Source/WebCore: Added SVG support for the CSS 'transform-origin' property and for percentage values in the transform translate function. The changes conform to http://dev.w3.org/csswg/css3-transforms/. Tests: svg/transforms/percent-transform-values.xhtml svg/transforms/transform-origin-css-property.xhtml * css/svg.css: (*): (html|* > svg): Default transform-origin for SVG elements is 0 0. * platform/Length.h: (WebCore::Length::calcFloatValue): Added a calcFloatValue overload whose max parameter (for percent lengths) is a float. The original version will be obsolete when the sub-pixel layout support is completed. * rendering/style/RenderStyle.cpp: * rendering/style/RenderStyle.h: (WebCore): (WebCore::requireTransformOrigin): Transforms that only include translations don't depend on the transform-origin. (WebCore::RenderStyle::applyTransform): SVG elements interpret non-percentage/keyword transform-origin values relative to their viewport, unlike HTML which interprets all transform-origin values relative to the element's origin. The new FloatRect applyTransform() function handles SVG semantics. Similarly, SVG elements interpret percentage/keyword transform-origin values relative to the origin of their objectBoundingBox(), HTML uses the borderBox. All this per http://dev.w3.org/csswg/css3-transforms/. * svg/SVGStyledTransformableElement.cpp: (WebCore::SVGStyledTransformableElement::animatedLocalTransform): LayoutTests: Added tests for SVG CSS transform-origin property support and for CSS translations specified with percentages and applied to an SVG element. * svg/transforms/change-transform-origin-css-expected.xhtml: Added. * svg/transforms/change-transform-origin-css.xhtml: Added. * svg/transforms/change-transform-origin-presentation-attribute-expected.xhtml: Added. * svg/transforms/change-transform-origin-presentation-attribute.xhtml: Added. * svg/transforms/percent-transform-values-expected.txt: Added. * svg/transforms/percent-transform-values.xhtml: Added. * svg/transforms/transform-origin-css-property-expected.xhtml: Added. * svg/transforms/transform-origin-css-property.xhtml: Added. Canonical link: https://commits.webkit.org/98109@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110532 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-03-13 02:45:38 +00:00
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<div style="position: absolute; left: 25px; top: 25px; width: 100px; height: 100px; background: green;"></div>
</body>
</html>