haikuwebkit/LayoutTests/svg/repaint/inner-svg-change-viewBox-co...

15 lines
628 B
XML
Raw Permalink Normal View History

Repaint issues on changing 'viewBox' of inner SVG https://bugs.webkit.org/show_bug.cgi?id=77903 Source/WebCore: Patch by Bear Travis <betravis@adobe.com> on 2012-02-15 Reviewed by Nikolas Zimmermann. Do not update the child viewbox/viewport transform to its parent coordinate system until after layout has stored the old bounds for repainting purposes. Test: svg/repaint/inner-svg-change-viewBox-contract.svg * rendering/svg/RenderSVGViewportContainer.cpp: (WebCore::RenderSVGViewportContainer::RenderSVGViewportContainer): (WebCore::RenderSVGViewportContainer::calcViewport): (WebCore): (WebCore::RenderSVGViewportContainer::calculateLocalTransform): (WebCore::RenderSVGViewportContainer::localToParentTransform): * rendering/svg/RenderSVGViewportContainer.h: (WebCore::RenderSVGViewportContainer::setNeedsTransformUpdate): (RenderSVGViewportContainer): * svg/SVGSVGElement.cpp: (WebCore::SVGSVGElement::svgAttributeChanged): LayoutTests: Adding test for 77903. When setting the viewbox on an inner svg element causes the content to become smaller, make sure that the area behind the content is redrawn. Patch by Bear Travis <betravis@adobe.com> on 2012-02-15 Reviewed by Nikolas Zimmermann. * platform/chromium/test_expectations.txt: * svg/repaint/inner-svg-change-viewBox-contract-expected.png: Added. * svg/repaint/inner-svg-change-viewBox-contract-expected.txt: Added. * svg/repaint/inner-svg-change-viewBox-contract.svg: Added. Canonical link: https://commits.webkit.org/95729@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@107893 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-16 07:16:34 +00:00
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="300" height="300" onload="runRepaintTest()">
<script xlink:href="../../fast/repaint/resources/repaint.js" />
<script><![CDATA[
function repaintTest() {
document.getElementById("inner").setAttribute("viewBox", "0 0 200 200");
}
]]></script>
<!-- blue rect's lower right edges should be visible after viewbox resizing -->
<rect width="200" height="200" fill="blue"/>
<svg id="inner" width="200" height="200" viewBox="0 0 100 100" preserveAspectRatio="none">
<rect width="100" height="100" fill="green"/>
</svg>
</svg>