From 8006680f67e968f74e19cb4bc857e32319cfaf84 Mon Sep 17 00:00:00 2001 From: "commit-queue@webkit.org" Date: Wed, 22 Feb 2012 20:31:11 +0000 Subject: [PATCH] Not correctly recalculating layout for elements within nested SVG elements https://bugs.webkit.org/show_bug.cgi?id=77535 Patch by Bear Travis on 2012-02-22 Reviewed by Dirk Schulze. Source/WebCore: Relatively positioned text is not correctly updating its position when the size of its nearest viewport changes. Updating to mark text for layout when viewPort size changes. Test: svg/repaint/inner-svg-change-viewPort-relative.svg * rendering/svg/SVGRenderSupport.cpp: (WebCore::SVGRenderSupport::layoutChildren): LayoutTests: Adding a repaint test for a relatively sized inner svg and inner svg content when its width/height changes. * platform/chromium/test_expectations.txt: * svg/repaint/inner-svg-change-viewPort-relative-expected.png: Added. * svg/repaint/inner-svg-change-viewPort-relative-expected.txt: Added. * svg/repaint/inner-svg-change-viewPort-relative.svg: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108537 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 15 +++++++++++++++ .../platform/chromium/test_expectations.txt | 3 +++ ...inner-svg-change-viewPort-relative-expected.png | Bin 0 -> 5297 bytes ...inner-svg-change-viewPort-relative-expected.txt | 15 +++++++++++++++ .../repaint/inner-svg-change-viewPort-relative.svg | 21 +++++++++++++++++++++ Source/WebCore/ChangeLog | 16 ++++++++++++++++ Source/WebCore/rendering/svg/SVGRenderSupport.cpp | 3 +++ 7 files changed, 73 insertions(+) create mode 100644 LayoutTests/svg/repaint/inner-svg-change-viewPort-relative-expected.png create mode 100644 LayoutTests/svg/repaint/inner-svg-change-viewPort-relative-expected.txt create mode 100644 LayoutTests/svg/repaint/inner-svg-change-viewPort-relative.svg diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 311ad89..63982d3 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,18 @@ +2012-02-22 Bear Travis + + Not correctly recalculating layout for elements within nested SVG elements + https://bugs.webkit.org/show_bug.cgi?id=77535 + + Reviewed by Dirk Schulze. + + Adding a repaint test for a relatively sized inner svg and inner svg content when + its width/height changes. + + * platform/chromium/test_expectations.txt: + * svg/repaint/inner-svg-change-viewPort-relative-expected.png: Added. + * svg/repaint/inner-svg-change-viewPort-relative-expected.txt: Added. + * svg/repaint/inner-svg-change-viewPort-relative.svg: Added. + 2012-02-22 Alexei Svitkine [chromium] Fix remaining compositing/rubberbanding test failures diff --git a/LayoutTests/platform/chromium/test_expectations.txt b/LayoutTests/platform/chromium/test_expectations.txt index f97b12b..defcdbd 100644 --- a/LayoutTests/platform/chromium/test_expectations.txt +++ b/LayoutTests/platform/chromium/test_expectations.txt @@ -933,6 +933,9 @@ BUGCR62433 WIN : fast/images/gif-loop-count.html = IMAGE // SVG TESTS // ----------------------------------------------------------------- +// New test requires rebaseline +BUGWK77535 : svg/repaint/inner-svg-change-viewPort-relative.svg = IMAGE IMAGE+TEXT + // New test, needs a rebaseline BUGWK77903 : svg/repaint/inner-svg-change-viewBox-contract.svg = IMAGE IMAGE+TEXT diff --git a/LayoutTests/svg/repaint/inner-svg-change-viewPort-relative-expected.png b/LayoutTests/svg/repaint/inner-svg-change-viewPort-relative-expected.png new file mode 100644 index 0000000000000000000000000000000000000000..0f0b69e35ee2bbe9202fd985e91d2eb614f0fe85 GIT binary patch literal 5297 zcmeI0TUb+97RNUr1;rL`1s#N7k)h7WrJ{gB2;OQP6ht^dK@&8h;Syto5J?E3qSyjX z#ueefz$25;>8Sl18I| z&(jRG-I(o>Dv{7-2y9|J3TX$~T9CNBfJCIUX z0=c%1&2DjyTl4jnA9zu#7bGt`n|vnbvD0H0XMU2)>7Uy?38PM%w=XIGoV@Vc<*Y-6 zAC%|h2ZZgJUs)aFU|V}&%jpXRdmbLC_4Z!{3Rbc?+EVn|>AK5Pg!2Rhv(S?u*hTX*8e1M^!u{1k!&mQ%fbH_E&r$Y!{{Oa27Ug^e3{xd z+d-}wea|sCcD8i9RHS}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Y-Ko1Wc>vs=VlyvzxG#%P1y%<|J z?RhmofSjYPGYOR}<0BG=ejr}3zp)Oht7?>)Cp$SZ)q_8jXCuzg5!Kh^K6b(MT+v4$ z4fQ-}l}!mF0t{6PIfAUI{I}S}AZKU4O;-h45h){tdnbn_^kMQWf`c0KIdC;*G*CJ@ z*kifINFG)f7aAtIJ;qf~R?K-eA6AAM-8m9-~2-#gE~@Dp@2p!4^=*z!cQ2;B&mYg+Za zMh3b=`%BP`4wxPkZ-9uVZwCSB>qcK%JPJS?>h2#cHsE^T?_N;DdoS)G0GM*Yq0g7P z0WiHi$IoN_ALK4aov}l|ajAR9r@zO6cC@>G_A0ZPYy19J0v-3?y>36pz|IFCA>)qq vTrWLGV2;2XfjI(m1m+0L5%`k{j1%4NgiaK#c5Flc)PbGbBeqp-NjUv)ok1P$ literal 0 HcmV?d00001 diff --git a/LayoutTests/svg/repaint/inner-svg-change-viewPort-relative-expected.txt b/LayoutTests/svg/repaint/inner-svg-change-viewPort-relative-expected.txt new file mode 100644 index 0000000..dbb242d --- /dev/null +++ b/LayoutTests/svg/repaint/inner-svg-change-viewPort-relative-expected.txt @@ -0,0 +1,15 @@ +layer at (0,0) size 800x600 + RenderView at (0,0) size 800x600 +layer at (0,0) size 200x200 + RenderSVGRoot {svg} at (0,0) size 200x200 + RenderSVGViewportContainer {svg} at (0,0) size 200x200 + RenderSVGHiddenContainer {defs} at (0,0) size 0x0 + RenderSVGPath {polygon} at (0,0) size 20x20 [fill={[type=SOLID] [color=#FFFFFF]}] [points="0 0 0 20 20 10"] + RenderSVGRect {rect} at (0,0) size 200x200 [fill={[type=SOLID] [color=#0000FF]}] [x=0.00] [y=0.00] [width=200.00] [height=200.00] + RenderSVGRect {rect} at (180,60) size 20x20 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-20.00,0.00)}] [fill={[type=SOLID] [color=#FFFFFF]}] [x=200.00] [y=60.00] [width=20.00] [height=20.00] + RenderSVGText {text} at (93,86) size 107x18 contains 1 chunk(s) + RenderSVGInlineText {#text} at (0,0) size 107x18 + chunk 1 (end anchor) text run 1 at (93.00,100.00) startOffset 0 endOffset 18 width 107.00: "right-aligned text" + RenderSVGContainer {use} at (180,120) size 20x20 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-20.00,0.00)}] + RenderSVGContainer {g} at (180,120) size 20x20 [transform={m=((1.00,0.00)(0.00,1.00)) t=(200.00,120.00)}] + RenderSVGPath {polygon} at (180,120) size 20x20 [fill={[type=SOLID] [color=#FFFFFF]}] [points="0 0 0 20 20 10"] diff --git a/LayoutTests/svg/repaint/inner-svg-change-viewPort-relative.svg b/LayoutTests/svg/repaint/inner-svg-change-viewPort-relative.svg new file mode 100644 index 0000000..06e781c --- /dev/null +++ b/LayoutTests/svg/repaint/inner-svg-change-viewPort-relative.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + right-aligned text + + + diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 18f27be..d30f94d 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,19 @@ +2012-02-22 Bear Travis + + Not correctly recalculating layout for elements within nested SVG elements + https://bugs.webkit.org/show_bug.cgi?id=77535 + + Reviewed by Dirk Schulze. + + Relatively positioned text is not correctly updating its position when the + size of its nearest viewport changes. Updating to mark text for layout when + viewPort size changes. + + Test: svg/repaint/inner-svg-change-viewPort-relative.svg + + * rendering/svg/SVGRenderSupport.cpp: + (WebCore::SVGRenderSupport::layoutChildren): + 2012-02-22 Alexei Svitkine [chromium] Fix remaining compositing/rubberbanding test failures diff --git a/Source/WebCore/rendering/svg/SVGRenderSupport.cpp b/Source/WebCore/rendering/svg/SVGRenderSupport.cpp index f3e2cc6..4524a20 100644 --- a/Source/WebCore/rendering/svg/SVGRenderSupport.cpp +++ b/Source/WebCore/rendering/svg/SVGRenderSupport.cpp @@ -39,6 +39,7 @@ #include "RenderSVGResourceMarker.h" #include "RenderSVGResourceMasker.h" #include "RenderSVGRoot.h" +#include "RenderSVGText.h" #include "RenderSVGViewportContainer.h" #include "SVGResources.h" #include "SVGResourcesCache.h" @@ -264,6 +265,8 @@ void SVGRenderSupport::layoutChildren(RenderObject* start, bool selfNeedsLayout) // When the layout size changed and when using relative values tell the RenderSVGShape to update its shape object if (child->isSVGShape()) toRenderSVGShape(child)->setNeedsShapeUpdate(); + else if (child->isSVGText()) + toRenderSVGText(child)->setNeedsPositioningValuesUpdate(); needsLayout = true; } -- 2.7.4