Last Comment Bug 705206 - svg filter used in mask's group fails to render correctly
: svg filter used in mask's group fails to render correctly
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: SVG (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla11
Assigned To: Robert Longson
:
Mentors:
Depends on:
Blocks: 697904
  Show dependency treegraph
 
Reported: 2011-11-24 16:21 PST by Eugene
Modified: 2011-12-19 08:36 PST (History)
3 users (show)
longsonr: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
filter applied to group within a mask (754 bytes, image/svg+xml)
2011-11-24 16:21 PST, Eugene
no flags Details
patch (6.95 KB, patch)
2011-12-18 11:57 PST, Robert Longson
dholbert: review+
Details | Diff | Splinter Review

Description Eugene 2011-11-24 16:21:28 PST
Created attachment 576837 [details]
filter applied to group within a mask

If a filter is applied to <g> element within a mask, firefox fails to render. But if it is applied directly to child element of <g> it renders svg.

Please see the attachment for the not working svg.

Here are 2 svgs to demonstrate the issue: 
1)does not work on Firefox(works on chrome)
<svg width="600" height="400" xmlns="http://www.w3.org/2000/svg" bbheight="210" bbwidth="250">
 <!-- Created with ImageBot - http://www.imagebot.com/ -->
 <g>
  <defs>
   <filter y="90" width="250" height="210" x="90" filterUnits="userSpaceOnUse" id="imagebot_6">
    <feGaussianBlur stdDeviation="6" result="back"/>
   </filter>
  </defs>
  <title>Layer 1</title>
  <g id="imagebot_1">
   <mask id="imagebot_5" x="0" y="0" width="1" height="1">
    <g id="imagebot_7" filter="url(#imagebot_6)">
     <rect  x="100" y="100" width="250" height="210" fill="grey" id="imagebot_2" />
    </g>
   </mask>
   <g id="imagebot_3" mask="url(#imagebot_5)">
    <rect x="100" y="100" width="250" height="210" fill="red" id="imagebot_4"/>
   </g>
  </g>
 </g>
</svg>

2)works on Firefox(works on chrome)
<svg width="600" height="400" xmlns="http://www.w3.org/2000/svg" bbheight="210" bbwidth="250">
 <!-- Created with ImageBot - http://www.imagebot.com/ -->
 <g>
  <defs>
   <filter y="90" width="250" height="210" x="90" filterUnits="userSpaceOnUse" id="imagebot_6">
    <feGaussianBlur stdDeviation="6" result="back"/>
   </filter>
  </defs>
  <title>Layer 1</title>
  <g id="imagebot_1">
   <mask id="imagebot_5" x="0" y="0" width="1" height="1">
    <g id="imagebot_7" >
     <rect  x="100" y="100" width="250" height="210" fill="grey" id="imagebot_2" filter="url(#imagebot_6)"/>
    </g>
   </mask>
   <g id="imagebot_3" mask="url(#imagebot_5)">
    <rect x="100" y="100" width="250" height="210" fill="red" id="imagebot_4"/>
   </g>
  </g>
 </g>
</svg>


The only difference is that filter reference is moved from <g> element directly to the child in this case <rect>.
Comment 1 Robert Longson 2011-12-18 11:57:07 PST
Created attachment 582694 [details] [diff] [review]
patch

children of masks have no valid covered rect as masks are not directly displayable so we skip drawing them when there's a filter present as filters calculate their own dirty rects.
Comment 3 Marco Bonardo [::mak] 2011-12-19 08:36:55 PST
https://hg.mozilla.org/mozilla-central/rev/f21424ec84e6

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