Transparent SVG in iOS WebKit

WebKit had an error due to which the embedded SVG (from <embed>or <image>) had a white background instead of a transparent one.

It has been fixed, but not on iOS, where there is a much older version of WebKit

Is there any good workaround for this? I desperately need a transparent background.

I know two suboptimal workarounds:

  • Use the tag <img>. - I cannot do this because the DOM / XML SVG tree inserted as imgs cannot be moved / processed.

  • Compose the <object>or element <embed>. Surprisingly, the old WebKit can detect transparency if SVG is used as a mask. However, I find this an ugly solution:

    <object style="-webkit-mask-image:url(image.svg);" data="image.svg" type="image/svg+xml" />

Is there any good solution?

+3
source share
2

.

SVG/XML. , SVG DOM.

, XML Content-type (text/xml - , )

+1

, , . iOS, ? PNG ?

0

Source: https://habr.com/ru/post/1786675/


All Articles