Closed Bug 271552 Opened 20 years ago Closed 18 years ago

Opacity of elements referencing a gradient isn't respected (opacity, fill-opacity and stroke-opacity)

Categories

(Core :: SVG, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 357163

People

(Reporter: bugzilla, Unassigned)

Details

Attachments

(3 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a5) Gecko/20041122

When drawing a line that has a stroke defined by a linear gradient, the opacity
attribute is ignored. In the following example, only the first line should be
displayed, the second one should be invisible. However, with current build, both
lines are shown.

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg 
	xmlns="http://www.w3.org/2000/svg" 
	xmlns:xlink="http://www.w3.org/1999/xlink" 
	viewbox="0 0 100 100">
	<defs>
		<linearGradient id="hardGradient">
			<stop offset="0%" stop-color="#0000ff"/>
			<stop offset="100%" stop-color="#ffffff"/>
		</linearGradient>
	</defs>
	<g id="testGroup">
		<rect x="0" y="0" width="100" height="100" style="stroke:none;fill:#ddddff;"/>
		<line x1="10" y1="30" x2="90" y2="30" style="stroke:url(#hardGradient);
opacity:100; stroke-width: 5;"/>
		<line x1="10" y1="60" x2="90" y2="60" style="stroke:url(#hardGradient);
opacity:0; stroke-width: 5;"/>
	</g>
</svg>

Reproducible: Always
Steps to Reproduce:
1. Create linear gradient
2. Create a line element and assign its stroke to the defined linear gradient
3. Assign opacity 0 with line.

Actual Results:  
Line was shown

Expected Results:  
Line should have been invisible
Attached image TESTCASE
Note, the reporter isn't refering to stop-opacity, but rather the opacity of
the element referencing the gradient. We get this behaviour for both fill and
stroke. Here's a testcase.
The rect shouldn't be visible when you view the testcase BTW. Changing summary
to make it clear we're not talking about stop-opacity.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Opacity not respected when linear gradient is used → Opacity of elements referencing a gradient isn't respected
Flags: testcase+
I'm seeing the rectangle on:
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b4) Gecko/20050915 Firefox/1.4

Suggest changing Platform/OS to all.
Summary: Opacity of elements referencing a gradient isn't respected → Opacity of elements referencing a gradient isn't respected (opacity, fill-opacity and stroke-opacity)
This test case specifically tests the "fill-opacity" attribute when using a gradient fill
Attached image Clearer attachment
Trying to add a new test case to readily demonstrate the issue. This bug seems to be overlooked, so I am trying to make the situation clearer.

Test against Firefox 2.0 and still broken.

*** This bug has been marked as a duplicate of 357163 ***
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → DUPLICATE
Flags: in-testsuite+
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: