Closed Bug 448906 Opened 17 years ago Closed 16 years ago

SVG objects with patterned fills in files saved by some versions of Inkscape show incorrect patterns in Firefox 3.0.1

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
status1.9.2 --- beta1-fixed

People

(Reporter: will.pittenger1+mozbugzilla, Assigned: longsonr)

References

()

Details

Attachments

(8 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 Build Identifier: Examine the fill for the checkered pattern in the start/finish line of the page given. It should be a checker board with white and black squares alternating. For me, it doesn't show that. Instead, I see the attached images. The first shows what I see. The second shows what should be visible. The third is the problem SVG with everything except that object deleted. Reproducible: Always Steps to Reproduce: 1. View the SVG Actual Results: Pattern won't be displayed correctly Expected Results: Checker board pattern to display as alternating white and black squares
This shows what I see when I use FF 3.0.1 to view the SVG.
Attached image Testcase 1 (broken)
Even more reduced testcase. Referencing a transformed pattern from a transformed element via |xlink:href| causes the problem. <rect/> -> <pattern @xlink:href -> <pattern/> />
Attached image Testcase 2 (works)
Even more reduced testcase. Referencing a transformed pattern from a transformed element directly doesn't causes the problem. <rect/> -> <pattern/>
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Hardware: x86 → All
Version: unspecified → Trunk
Attached image Testcase 1 + 2 (broken)
Mysteriously, rendering pattern referenced directly is failed when |xlink:href|ed pattern was rendered before. <rect/> -> <pattern @xlink:href -> <pattern/> /> <rect/> -> <pattern/> both are wrong rendering.
Attachment #399678 - Attachment description: Testcase (broken) → Testcase 1 (broken)
Attachment #399679 - Attachment description: Testcase (works) → Testcase 2 (works)
Attached image Testcase 2 + 1 (works)
Rendering |xlink:href|ed pattern is when pattern referenced directly was rendered before. <rect/> -> <pattern/> <rect/> -> <pattern @xlink:href -> <pattern/> /> both are O.K.
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → longsonr
Attachment #408268 - Flags: review?(roc)
Thanks for the testcases Takeshi. I would not have been able to fix this without them.
if (!mPaintLoopFlag) { mPaintLoopFlag = PR_TRUE; Should we be setting/checking mPaintLoopFlag on patternFrame? Should we just be calling nsSVGPatternFrame::PaintPattern on patternFrame instead?
(In reply to comment #10) > if (!mPaintLoopFlag) { > mPaintLoopFlag = PR_TRUE; > > Should we be setting/checking mPaintLoopFlag on patternFrame? I can change this as it's the only member variable that paintPattern sets and I guess it does make more sense to set it on the pattern you're rendering. However, I don't think it makes much difference. If there is a loop then either you come back round to the current frame or the linked frame and you'll see the flag set at some point either on the current frame or the linked frame. > > Should we just be calling nsSVGPatternFrame::PaintPattern on patternFrame > instead? This we can't do. We need to start from the current frame not the linked frame to get pattern attributes. e.g. with pattern x="3" xlink:href="..." we need to get x="3"
Attachment #408268 - Attachment is obsolete: true
Attachment #408293 - Flags: review?(roc)
Attachment #408268 - Flags: review?(roc)
Status: NEW → RESOLVED
Closed: 16 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Comment on attachment 408293 [details] [diff] [review] patternFrame->mPaintLoop I think it might be worth taking this in 1.9.2 although I don't know how prevalent this is in Inkscape generated files. Pretty simple low risk fix that includes a test.
Attachment #408293 - Flags: approval1.9.2?
Attachment #408293 - Flags: approval1.9.2? → approval1.9.2+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: