Closed Bug 374293 Opened 17 years ago Closed 17 years ago

Resizing text element from SVG zoom handler can cause image to disappear

Categories

(Core :: SVG, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: duncan.loveday, Unassigned)

References

Details

(Keywords: regression)

Attachments

(3 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a3pre) Gecko/20070316 Minefield/3.0a3pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a3pre) Gecko/20070316 Minefield/3.0a3pre

Updating the attribute "font-size" of an SVG text element from within a zoom event handler can cause the image to disappear.




Reproducible: Always

Steps to Reproduce:
1. Place the attached test.html and test.svg in a directory.
2. Open test.html in Firefox
3. Click "zoom out". 
Actual Results:  
The image disappears.

Expected Results:  
The image should be zoomed out.

In the test case, the SVG is incorporated via <EMBED> and the embed is dynamically re-sized to fit the zoomed image (by updating its height and width attributes to match SVGRoot.currentScale). In this scenario the image consistently disappears and never reappears until the document is reloaded.

However, commenting out the dynamic resize of the embed creates another scenario where the image disappears on the first zoom out then reappears on the next zoom out, then disappears again on the next zoom out and so on. There are comments in the HTML source about what to comment out.

Bizzarely, adding a <P> just before the embed affects the behaviour of this latter scenario: the image then does not disappear.

Removing the line that re-sizes the text makes everything work.

Test case works fine in FF2.
Attached file test HTML source (obsolete) —
Attached image test SVG source
Keywords: regression
Regression on 7 December 2006, which points to bug 300030 as the only one.
Here's a different testcase. When you click on the SVG it changes the font-size on the text element. Notice that every second click the area covered by the text will be wiped (white) but not be redrawn. Also notice that when this happens if you cover the window with another window then return to the SVG, the part of the SVG you covered with the second window will now also be white. This would seem to indicate that the bug here is strongly related to bug 369850.
Status: UNCONFIRMED → NEW
Depends on: 369850
Ever confirmed: true
Jonathan, I've also seen an effect where the image appears to be OK until you scroll it and then the bits coming into view contain white instead of a portion of the image (e.g. if scrolling the image up a white area appears at the bottom instead of the next bit of image). By scrolling up and then down again or vice versa you end up with a completely white image. I couldn't recreate this in a simple test case though, but the problem resolves when I stop re-scaling text from my zoom handler so I'm hoping its another manifestation of the same issue.

I was thinking about what the severity of this ought to be...I guess not that many people will want to scale text from a zoom handler but for those that do (e.g. to obtain invariant sized text) there is no workaround I can find and I suppose the fact that it is a regression ought to come into it as people will be offended if their existing apps break.

Leaving as "normal" for now.
FWIW a usable workaround seems to be to remove the text from the root element (SVGRoot.removeChild(theText);), change the font size and re-insert the text (SVGRoot.appendChild(theText);)
Depends on: 380516
Fixed by checkin for bug 380516 
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Flags: in-testsuite?
No longer depends on: 369850
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: