RESOLVED DUPLICATE of bug 256702 128589
Percentage positioning inside SVG symbol
https://bugs.webkit.org/show_bug.cgi?id=128589
Summary Percentage positioning inside SVG symbol
Pavel Manylov
Reported 2014-02-11 01:45:08 PST
Created attachment 223828 [details] screenshot: Firefox (top left, works properly), Chrome (right), latest WebKit (bottom left) According to SVG specification: >> Additionally, there is a new meaning for percentage units defined to be relative to the current viewport since a new viewport has been established >> … >> A ‘symbol’ element define new viewports whenever they are instanced by a ‘use’ element. >> http://www.w3.org/TR/SVG11/coords.html#EstablishingANewViewport" However, in WebKit (latest WebKit, Safari, dev version of Google Chrome) positioning using percentage cause incorrect positioning relative to main <svg> element. Sometimes (as presented in attachment) elements with such positioning WebKit not renders at all, in latest Safari it renders element incorrectly and then removes rendered element. On screenshot: Firefox (top left, works properly), Chrome (right), latest WebKit (bottom left). Test SVG Document: <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink = "http://www.w3.org/1999/xlink" width="100%" height="100%" viewBox = "0 0 1000 1000" preserveAspectRatio = "true"> <defs> <symbol id="blueCircle" viewBox="0 0 100 100"> <circle cx="50" cy="50" r="50" style="fill: blue;"/> </symbol> <symbol id="mainItem" viewBox="0 0 100 100"> <circle cx="50" cy="50" r="50" style="fill: yellow;"/> <use xlink:href="#blueCircle" height="10" width="10" x="45" y="45"/> </symbol> <symbol id="whoIsNowAMainItemHuh" viewBox="0 0 300 300"> <use xlink:href="#mainItem" x="0" y="0" width="100" height="100"/> <use xlink:href="#mainItem" x="100" y="100" width="100" height="100"/> <!-- here % should be relative to the `use` of current `symbol` --> <use xlink:href="#mainItem" x="65%" y="65%" width="100" height="100"/> </symbol> </defs> <rect width="1000" height="1000" x="0" y="0" style="fill: green;"/> <use xlink:href="#whoIsNowAMainItemHuh" width="600" height="600" x="100" y="100"/> </svg>
Attachments
screenshot: Firefox (top left, works properly), Chrome (right), latest WebKit (bottom left) (185.04 KB, image/png)
2014-02-11 01:45 PST, Pavel Manylov
no flags
Test case (1.02 KB, image/svg+xml)
2014-07-12 23:18 PDT, Dirk Schulze
no flags
Dirk Schulze
Comment 1 2014-07-12 23:18:58 PDT
Created attachment 234826 [details] Test case
Ahmad Saleem
Comment 2 2022-07-10 11:55:58 PDT
I am able to reproduce this bug in Safari 15.5 on macOS 12.4 and Safari Technical Preview 148, it shows just two circles like in attached screenshot on attached test case. All other browsers (Chrome Canary 105 and Firefox Nightly 104) match each other and aligned with screenshot of showing three circles. Thanks!
Brent Fulgham
Comment 3 2022-07-15 16:50:57 PDT
Firefox and chrome handle this properly, Safari does not.
Radar WebKit Bug Importer
Comment 4 2022-07-15 16:51:09 PDT
Ahmad Saleem
Comment 5 2023-06-01 05:50:32 PDT
Working fine now in WebKit ToT (264792@main) (but broken in STP171).
Said Abou-Hallawa
Comment 6 2023-06-01 12:24:06 PDT
This is fixed by the fix of bug 256702 (264596@main). *** This bug has been marked as a duplicate of bug 256702 ***
Note You need to log in before you can comment on or make changes to this bug.