Closed Bug 445291 Opened 16 years ago Closed 16 years ago

SVG linearGradient not always rendered

Categories

(Core :: SVG, defect)

x86
Windows Vista
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: vezquex, Unassigned)

References

()

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 A use element references a rect element in the defs tag. The rect element is to be filled by a linearGradient. The previous setup is generated by JavaScript in two slightly different ways and yet only the first way works. Both techniques work in Opera 9.5. Reproducible: Always Steps to Reproduce: 1. 2. 3.
Component: General → SVG
Product: Firefox → Core
QA Contact: general → general
Something in your javascript code is converting linearGradient to lineargradient for myGradient2. SVG is case sensitive.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → INVALID
Thanks for your report vezquex. I couldn't believe that Opera was case-insensitive so I dug into this a little. It seems like this comes down to Mozilla normalizing element names in HTML whereas Opera preserves the case. I'm sure there must be a bug open on this, but I couldn't find it. More detail on what's happening in this particular testcase: some way under the svg.add(defs, ...) call, the 'clean' function in jquery-1.2.6.js (at the line "Go to html and back") appears to convert the 'linearGradient' element to an *HTML* node, then back to a string. I'd assume it's somewhere here (or somewhere similar) that "linearGradient" gets converted to "lineargradient". CC'ing a few folks who might know more about that.
The testcase in the URL seems to work now. What change did you make vezquex?
> It seems like this comes down to Mozilla normalizing element names in HTML > whereas Opera preserves the case. I'm sure there must be a bug open on this, > but I couldn't find it. Last I checked, the normalizing behavior is correct (pending whatever HTML5 does with svg integration).
Sorry, I was working around the problem by replacing 'lineargradient' with 'linearGradient'. The original test case has been restored now.
You need to log in before you can comment on or make changes to this bug.