Closed Bug 891650 Opened 11 years ago Closed 11 years ago

Mask using gradient gets clipped in SVG-as-image

Categories

(Core :: Graphics, defect)

24 Branch
All
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla25
Tracking Status
firefox22 --- unaffected
firefox23 --- unaffected
firefox24 + fixed
firefox25 + fixed
firefox-esr17 --- unaffected

People

(Reporter: birtles, Assigned: jrmuizel)

References

()

Details

(Keywords: regression)

Attachments

(5 files)

In Fx 24 and 25, referencing an SVG that contains masks with gradients from an <img> element often results in an incorrect masking.

In the (forthcoming) test case, part of the masked box is clipped when shown in Fx 24 or 25 but renders correctly in Fx 23 and earlier or when viewing the SVG image by itself (not through an <img> element).

In the test URL, many of the diagrams are completely unreadable. For example, Figure 8.
gfx.content.azure.enabled = false fixes the problem


Regression window(m-i)
Good:
http://hg.mozilla.org/integration/mozilla-inbound/rev/e6d1090425fc
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20130621 Firefox/24.0 ID:20130621203502
Bad:
http://hg.mozilla.org/integration/mozilla-inbound/rev/872cb1c92a73
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20130621 Firefox/24.0 ID:20130621204604
Pushlog:
http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=e6d1090425fc&tochange=872cb1c92a73
Component: SVG → Graphics
Version: Trunk → 24 Branch
This was likely bug 885020
Blocks: 885020
Assignee: nobody → jmuizelaar
(In reply to Brian Birtles (:birtles) from comment #0)
> In the test URL, many of the diagrams are completely unreadable. For
> example, Figure 8.

(I think you forgot to include the actual test URL, unless I overlooked it?)
Flags: needinfo?(birtles)
Also, FWIW, this worksforme with Nightly on my Linux desktop, with the attached testcase. I'm seeing something that looks just like the attached "Result in Fx 23", in latest linux Nightly (Gecko/20130710 Firefox/25.0).
(In reply to Daniel Holbert [:dholbert] from comment #6)
> (I think you forgot to include the actual test URL, unless I overlooked it?)

Yep, no idea what happened there. Fixed.
Flags: needinfo?(birtles)
It's also probably worth mentioning that if I remove the line of text in the test case the cropped region is less severe. In fact, the masked region appears to be unchanged in both cases. It's as if it's being calculated relative to the document viewport not the SVG viewport.
GetDTTransform does not include the device offset. We need that in order for things to work properly.
Attachment #774211 - Flags: review?(bas)
(In reply to Joe Drew (:JOEDREW! \o/) from comment #10)
> Created attachment 774211 [details] [diff] [review]
> This seems to do the trick
> 
> GetDTTransform does not include the device offset. We need that in order for
> things to work properly.

This comment was actually me :)
https://hg.mozilla.org/mozilla-central/rev/d1cbd2f59347
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Comment on attachment 774211 [details] [diff] [review]
This seems to do the trick

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 885020
User impact if declined: Some broken SVG content
Testing completed (on m-c, etc.): on m-c, includes a reftests
Risk to taking this patch (and alternatives if risky): Relatively low risk, and very easy to back out.
Attachment #774211 - Flags: review?(bas) → approval-mozilla-aurora?
Attachment #774211 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
(In reply to Brian Birtles (:birtles) from comment #0)
> Created attachment 772985 [details]
> SVG file referred to from test case
> 
> In Fx 24 and 25, referencing an SVG that contains masks with gradients from
> an <img> element often results in an incorrect masking.
> 
> In the (forthcoming) test case, part of the masked box is clipped when shown
> in Fx 24 or 25 but renders correctly in Fx 23 and earlier or when viewing
> the SVG image by itself (not through an <img> element).
> 
> In the test URL, many of the diagrams are completely unreadable. For
> example, Figure 8.

can you please help verify this is fixed for you once this lands on aurora ?
Thanks !
(In reply to bhavana bajaj [:bajaj] from comment #14)
> can you please help verify this is fixed for you once this lands on aurora ?
> Thanks !

Yes, of course. I'll wait until the next build.
Flags: needinfo?(birtles)
Confirming that it is fixed for me. Do I set the verify status or is that still QA's job?
Flags: needinfo?(birtles)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: