RESOLVED FIXED 77535
Not correctly recalculating layout for elements within nested SVG elements
https://bugs.webkit.org/show_bug.cgi?id=77535
Summary Not correctly recalculating layout for elements within nested SVG elements
zscregan
Reported 2012-02-01 02:13:27 PST
Created attachment 124911 [details] Test - Both Images Should Be Identical I created and attached a test case. Both images should look identical, but for some reason WebKit doesn't seem to recalculate the position of relatively positioned elements whose parent node is a nested <svg> element, whenever that <svg> element is repositioned dynamically. The bug also appears when the browser window is resized since the nested <svg> element is relatively positioned to the browser window. For example: <svg> <svg id="NestedSVG" width="50%"> <rect x="0" y="0" width="100%" height="100%" /> </svg> </svg> NestedSVG.setAttribute('width', '75%');
Attachments
Test - Both Images Should Be Identical (3.97 KB, text/html)
2012-02-01 02:13 PST, zscregan
no flags
Simplified Testcase -- green square (441 bytes, image/svg+xml)
2012-02-16 11:45 PST, Bear Travis
no flags
Proposed Patch (3.23 KB, patch)
2012-02-21 15:20 PST, Bear Travis
gustavo: commit-queue-
updated patch (9.29 KB, patch)
2012-02-21 15:24 PST, Bear Travis
no flags
updated patch (9.53 KB, patch)
2012-02-21 16:01 PST, Bear Travis
no flags
Tim Horton
Comment 1 2012-02-15 11:35:04 PST
While not a regression, this seems pretty broken.
Radar WebKit Bug Importer
Comment 2 2012-02-15 11:42:32 PST
Bear Travis
Comment 3 2012-02-15 15:49:08 PST
The patch for 77903 should fix this as part of updating the viewport/viewbox inner svg transform. I will double check and add a test case once 77903 has landed.
Bear Travis
Comment 4 2012-02-16 11:45:46 PST
Created attachment 127421 [details] Simplified Testcase -- green square This svg uses a timeout to change the inner svg width to 100% after 2 seconds. You should see a tall green rectangle then a green square.
zscregan
Comment 5 2012-02-16 12:47:09 PST
I'm using the latest Chromium build (19.0.1045.0) for testing so I'm not 100% positive that I'm on the latest build of WebKit. With that being said, the second 'green square' test case is now passing. But my original test case is still not passing. It's much better now, but the <text> element still isn't getting re-positioned. I think it's important to include different elements in the test case to ensure that they're re-positioned properly as well. I think at least one type of shape (<rect> for example), <text>, and a <use> element should be included. As an additional example of why I think it's important to include other elements, the latest version of Firefox has a very similar bug but only with <use> elements.
Bear Travis
Comment 6 2012-02-16 13:31:29 PST
I see, I hadn't noticed the text. The general resizing working should be due to the patch for 77903. I'll need to take a look at exactly why the text is not repositioning correctly.
Bear Travis
Comment 7 2012-02-21 15:20:57 PST
Created attachment 128055 [details] Proposed Patch After the patch for 77903, there was only a problem with relatively positioned text. Text needs to be marked to reposition itself whenever the viewport size changes, similar to how shapes are being marked in SVGRenderSupport::layoutChildren. Running the bots, then will mark for review.
Gustavo Noronha (kov)
Comment 8 2012-02-21 15:23:44 PST
Comment on attachment 128055 [details] Proposed Patch Attachment 128055 [details] did not pass gtk-ews (gtk): Output: http://queues.webkit.org/results/11556297
Bear Travis
Comment 9 2012-02-21 15:24:05 PST
Created attachment 128057 [details] updated patch including the new test files
Bear Travis
Comment 10 2012-02-21 16:01:47 PST
Created attachment 128067 [details] updated patch adding a header to fix the gtk build failure
WebKit Review Bot
Comment 11 2012-02-22 12:30:57 PST
Comment on attachment 128067 [details] updated patch Clearing flags on attachment: 128067 Committed r108537: <http://trac.webkit.org/changeset/108537>
WebKit Review Bot
Comment 12 2012-02-22 12:31:02 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.