Last Comment Bug 765031 - Issue creating an SVG element at run time, loading an image within an <image> element and being masked by a <mask> element.
: Issue creating an SVG element at run time, loading an image within an <image>...
Product: Core
Classification: Components
Component: SVG (show other bugs)
: 13 Branch
: x86 Windows 7
-- trivial (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: Jet Villegas (:jet)
Depends on:
  Show dependency treegraph
Reported: 2012-06-14 14:30 PDT by jivory
Modified: 2012-07-22 11:51 PDT (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

my attempt (1.46 KB, text/html)
2012-06-15 01:07 PDT, Robert Longson
no flags Details

Description User image jivory 2012-06-14 14:30:45 PDT
User Agent: Mozilla/5.0 (Windows NT 6.1; rv:13.0) Gecko/20100101 Firefox/13.0
Build ID: 20120601045813

Steps to reproduce:

I was using Javascript to build an SVG element with the structure of
  <mask id="myMask">
    <g />
  <image mask="url(#myMask)" />

Actual results:

At run time, FF would throw a strange error (I forget the exact one), but the SVG would be created, image loaded, and masked in Chrome, IE9 and Safari. This error would cause the script to fail and SVG not rendered.

Expected results:

The SVG should have been created, image loaded and masked.

To resolve the issue, I create the svg without the mask:
  <g />
  <image />

And after the image has been fully loaded, I then wrap the <g /> tag with the <mask> and it works fine. Other browsers do not require this to work.
Comment 1 User image Boris Zbarsky [:bz] (still a bit busy) 2012-06-14 22:38:19 PDT
Can you attach the exact script you were using?  Or at least say what the error was?  Because so far, there isn't much to go on in this bug, unfortunately.
Comment 2 User image Robert Longson 2012-06-15 01:07:09 PDT
Created attachment 633431 [details]
my attempt

This works for me in firefox 13. Is it what you did?
Comment 3 User image jivory 2012-06-15 07:36:47 PDT
It was a while back, I've since just compensated and changed my code as a workaround. I'll try to replicate it again and post the error I was given.
Comment 4 User image Boris Zbarsky [:bz] (still a bit busy) 2012-06-15 08:46:44 PDT
Post the code too, please?  As things stand, there's really nothing we can do here...
Comment 5 User image Robert Longson 2012-07-22 11:51:14 PDT
Feel free to reopen if you produce a testcase.

Note You need to log in before you can comment on or make changes to this bug.