Closed Bug 590434 Opened 14 years ago Closed 7 years ago

SVG filter are not fully applied when changing an HTML img source

Categories

(Core :: SVG, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 577824

People

(Reporter: Jeremie, Assigned: u459114)

References

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows NT 5.1; rv:2.0b5pre) Gecko/20100823 Minefield/4.0b5pre
Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:2.0b5pre) Gecko/20100823 Minefield/4.0b5pre

This bug is about SVG filter applied to HTML img element.

If you have an HTML img element without explicit width and height and if you apply an SVG filter to it, everything is ok (except in the case of bug 577824)

Now, if you change the src attribut of the img element and if the size of the new source is bigger than the old one, the filter is partially applied and crop the image.

Reproducible: Always

Steps to Reproduce:
1. See the attach test case
 
Actual Results:  
The test case show a cropped green square.

Expected Results:  
The test case should show two green squares.
Attached file Test case (obsolete) —
It seems (this need to be confirm) that because of bug 577824, the first time you see the test case, you'll see 2 blue squares instead of the expected result.
Depends on: 577824
Haven't looked at the testcase's source in detail, but are you sure it's not a problem with the testcase?  I just checked mozilla-central trunk, Opera 10.61, and Midori (Webkit) all on Linux, and none of them give your expected results.
(they're all different from each other, though -- mozilla-central gives me one and a half green squares + half a blue square, Opera gives the same but with s/green/red/, and Midori gives me two blue squares with broken-image icons in the upper-left corner.)
Attached file HTML Test case
Fixed version of the previous test case.
Attachment #468972 - Attachment is obsolete: true
(In reply to comment #2)
> are you sure it's not a problem with the testcase?

Oups, you're right, there was a little bug in this test case (a duplicate ID on the img tags), It's fixed now. But still, the problem remain.

Let me explain the test case further to make it a bit more understandable.

This test case is HTML5 based so you need a HTML5+inline SVG capable brother that support filter on HTML elements (such as Mozilla central)

The test case consists of two red images put inside two 200x200px div elements that have a blue background. The filter turn both images into green.

The first image is a 200x200px square, so, if the filter is well applied, you should see a green square. It acts as a reference rendering.

The second image is a 200x100px rectangle which is turn into a 200x200px square by changing it's src attribute when the window load event occurs.

So, at that point, what's happen to each different browser mention in #comment2 :

 - Mozilla central : The first image is well renders, it's a green square. The second image is cropped so you can see a green rectangle (which is a bit bigger than the previous image!) and a blue rectangle.

 - Opera 10.61 (and 10.70b9034 as well) : You should see two red square because Opera does not support (yet) inline SVG inside HTML5 documents (the fixed test case acts this way now).

 - Midori should behave the same as Opera (and Chromium nightly builds on Linux handle this exactly as Opera). I think that if Midori gives broken image icons it's because it does not support data URIs (but this is very odd for a webkit based browser). I use them to provide a single file test case.
Assignee: nobody → cku
Confired the patch in Bug 577824 can fix this bug as well
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: