The following testcase triggers this assert: <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <rect id="rect" x="0" y="100" width="50" height="50" fill="white" mask="url(#mask4)"/> <defs> <mask id="mask4"> </mask> </defs> </svg> Though this unusual SVG, I am pretty sure it is valid. Cheers, Rob.
*** This bug has been marked as a duplicate of bug 47682 ***
(In reply to comment #0) > The following testcase triggers this assert: > > <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> > <rect id="rect" x="0" y="100" width="50" height="50" fill="white" mask="url(#mask4)"/> > <defs> > <mask id="mask4"> > </mask> > </defs> > </svg> > > Though this unusual SVG, I am pretty sure it is valid. > Cheers, > > Rob. If I reference the rect after the <defs> section by a <use> element, the test works, but if it is before this section, it asserts as well. So it might be a problem that the parsing of the document did not finished and the resources are unknown. Note, this only happens for mask and filter, but not for clipper, gradient or pattern.
(In reply to comment #2) > (In reply to comment #0) > > The following testcase triggers this assert: > > > > <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> > > <rect id="rect" x="0" y="100" width="50" height="50" fill="white" mask="url(#mask4)"/> > > <defs> > > <mask id="mask4"> > > </mask> > > </defs> > > </svg> > > > > Though this unusual SVG, I am pretty sure it is valid. > > Cheers, > > > > Rob. > > If I reference the rect after the <defs> section by a <use> element, the test works, but if it is before this section, it asserts as well. So it might be a problem that the parsing of the document did not finished and the resources are unknown. Note, this only happens for mask and filter, but not for clipper, gradient or pattern. <use> elements are way trickier to understand. The attach time is different, the <use> rendering subtree is built delayed, so the layout flow is completly different than using no <use> element.
(In reply to comment #3) > (In reply to comment #2) > > (In reply to comment #0) > > > The following testcase triggers this assert: > > > > > > <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> > > > <rect id="rect" x="0" y="100" width="50" height="50" fill="white" mask="url(#mask4)"/> > > > <defs> > > > <mask id="mask4"> > > > </mask> > > > </defs> > > > </svg> > > > > > > Though this unusual SVG, I am pretty sure it is valid. > > > Cheers, > > > > > > Rob. > > > > If I reference the rect after the <defs> section by a <use> element, the test works, but if it is before this section, it asserts as well. So it might be a problem that the parsing of the document did not finished and the resources are unknown. Note, this only happens for mask and filter, but not for clipper, gradient or pattern. > > <use> elements are way trickier to understand. The attach time is different, the <use> rendering subtree is built delayed, so the layout flow is completly different than using no <use> element. Nevertheless, if you move the rect after the resource, it works.
(In reply to comment #4) > (In reply to comment #3) > > (In reply to comment #2) > > > (In reply to comment #0) > > > > The following testcase triggers this assert: > > > > > > > > <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> > > > > <rect id="rect" x="0" y="100" width="50" height="50" fill="white" mask="url(#mask4)"/> > > > > <defs> > > > > <mask id="mask4"> > > > > </mask> > > > > </defs> > > > > </svg> > > > > > > > > Though this unusual SVG, I am pretty sure it is valid. > > > > Cheers, > > > > > > > > Rob. > > > > > > If I reference the rect after the <defs> section by a <use> element, the test works, but if it is before this section, it asserts as well. So it might be a problem that the parsing of the document did not finished and the resources are unknown. Note, this only happens for mask and filter, but not for clipper, gradient or pattern. > > > > <use> elements are way trickier to understand. The attach time is different, the <use> rendering subtree is built delayed, so the layout flow is completly different than using no <use> element. > > Nevertheless, if you move the rect after the resource, it works. Sure, the order matters. I suspect we have a problem with the calls to RenderSVGResource:* in RenderSVGPath and other renderers.