A
A
A person from Kazakhstan2018-05-29 15:32:51
SVG
A person from Kazakhstan, 2018-05-29 15:32:51

Why such a bug with SVG mask?

So I often write svg myself or use editors for complex tasks! For example, right now I opened Lisa and the example made by my ruSO colleague and saw that nothing is displayed
. I also opened the well-known can in use , which says that the SVG mask is supported in Firefox, but real viewing convinced me otherwise!
There was also a post on the same SO about the fact that someone was doing SVG animation under IE11, of course I unsubscribed that this is not real if you believe the same can in use , that dude considered me stupid .... well, he unsubscribed that he works in that same IE11 and what the hell am I writing what I don't know
So what to believe? Isn't it possible now to install all web travelers and buy all OS and check everywhere?
What a crap?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Bogachev, 2018-05-29
@LenovoId

I also did not believe that there could be problems with the mask in FF. I already thought that you found a bug in the browser ... But everything turned out to be much simpler - in the answer to SO some kind of tin is going on with the sizes, I corrected it a little and it all worked:

<svg viewbox='0 0 100 100'>
    <defs>
        <mask id='mask'>
            <rect x='0' y='0' width='100' height='100' fill='rgba(255,255,255,0.5)' />
            <circle r='50' cx='50' cy='50' fill='#000' />
        </mask>
    </defs>
    <image xlink:href='....' x='0' y='0' width='100'height='100' />
    <rect x='0' y='0' width='100' height='100' fill='white' mask='url(#mask)' />
</svg>

There are no problems with the mask itself.
code pen

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question