RESOLVED FIXED 42944
SVG background doesn't resize properly when dimensions are changed
https://bugs.webkit.org/show_bug.cgi?id=42944
Summary SVG background doesn't resize properly when dimensions are changed
Radek Pietruszewski
Reported 2010-07-25 03:35:43 PDT
Created attachment 62522 [details] Bug test Overview: Given a div with SVG background and border, div's background doesn't resize when div's dimensions are changed (no matter if using JS animation, CSS transition, or just :hover) Steps to reproduce: 1. Make a <div> with SVG background 2. Add a border or an outline to this <div> (bug won't appear without this) 3. Change its dimensions in some way (easiest way is to use :hover) Actual results: Border changes its dimensions, but background stays in the same position Expected results: Background changes its dimensions accordingly to div Build Date & Platform: Safari 5.0 (6533.16) - which is WebKit 533, right? Additional Builds and Platforms: Works just fine on Opera 10.60 Additional Information: Sorry for my English ;)
Attachments
Bug test (2.38 KB, application/zip)
2010-07-25 03:35 PDT, Radek Pietruszewski
no flags
Dirk Schulze
Comment 1 2010-07-26 23:48:03 PDT
I can't reproduce it locally with trunk. Have you tested it with a nightly?
Radek Pietruszewski
Comment 2 2010-07-27 00:08:02 PDT
(In reply to comment #1) > I can't reproduce it locally with trunk. Have you tested it with a nightly? No until now (sorry for that - I'm the new one), but I can reproduce it on nightly.
Nikolas Zimmermann
Comment 3 2010-07-30 00:13:51 PDT
CC'in Dan Bernstein. Dan, do you know off-hand what might be the difference that the SVG background image doesn't resize anymore when a border is applied to the <div>? I'd be thankful for any hints.
Tim Horton
Comment 4 2011-06-21 11:14:56 PDT
As far as I can tell, this is a regression in r62922, which added RenderSVGRoot ::clippedOverflowRectForRepaint, which redirects the call to SVGRenderSupport instead of the superclass, RenderBox. SVGRenderSupport's implementation uses the m_repaintBoundingBox on the RenderSVGRoot, which is calculated using computeContainerBoundingBoxes, which only takes into account the bounding boxes of the children of the container! (that is to say, ignores the bounding box of the RenderSVGRoot, which includes the background!) We could fix this by making RenderSVGRoot::updateCachedBoundaries include the RenderSVGRoot's bounding box *in the case where it has a background*, but I'm not sure if that would break anything. Alternatively, we could just remove RenderSVGRoot::clippedOverflowRectForRepaint, leaving it to be forwarded to RenderBox, but I have a feeling it's done the way it is right now for performance reasons, so we should be careful with it. Any ideas? <rdar://problem/9474533>
Tim Horton
Comment 5 2011-06-21 17:23:38 PDT
Nevermind! This is actually separate from the r62922 regression, which I'll file a separate bug for tomorrow because it needs some discussion. Sorry!
Nikolas Zimmermann
Comment 6 2011-07-23 05:01:39 PDT
47156 fixes this.
Nikolas Zimmermann
Comment 7 2011-10-31 08:32:27 PDT
Fixed in r98852. Thanks for the testcase!
Note You need to log in before you can comment on or make changes to this bug.