Closed Bug 290967 Opened 20 years ago Closed 18 years ago

removeAttribute doesn't effect the underlying DOM properties

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 320622

People

(Reporter: harald.albrecht, Unassigned)

References

Details

Attachments

(2 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b2) Gecko/20050415 Firefox/1.0+ Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b2) Gecko/20050415 Firefox/1.0+ When removing the transform attribute, for instance, of a rectangle element, the element's corresponding transformation matrix should be reset to the identity matrix. However, with the current implementation, the matrix remains unchanged when the transform attribute is removed. Reproducible: Always Steps to Reproduce: 1. Load attached testcase 2. click on the black rectangle Actual Results: The black rectangle stays at its offset at (50,50). Expected Results: The black rectangle should have been moved to the origin at (0,0).
Attachment #181140 - Attachment mime type: text/html → text/xml
Eek! We aren't going to do much for any SVG attributes (unless they're intrinsic event attributes). See UnsetAttr for nsSVGElement: http://lxr.mozilla.org/seamonkey/source/content/svg/content/src/nsSVGElement.cpp#242 Here's another testcase that shows removeAttribute has no affect on the 'fill' or 'transform' attributes.
Attachment #181140 - Attachment is obsolete: true
Harald, for now just use setAttribute("") as well as removeAttribute. I think that should have the desired effect, at least most of the time.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 2000 → All
Hardware: PC → All
*** Bug 302762 has been marked as a duplicate of this bug. ***
We should probably make UnsetAttr first call SetAttr and pass it an empty string until we figure out something better.
Summary: removing the transform attribute does not reset transformations → removeAttribute doesn't effect the underlying DOM properties
unfortunatly the solution from comment #3 does not work in the case of bug#302702
Yeah, and nsSVGViewBox isn't designed to be "unset". If you find any other attributes that have the same problem, please note them here. Thanks Holger.
The attachment from comment #8: https://bugzilla.mozilla.org/attachment.cgi?id=196132 seems to be working now in the latest nightly but the attachment: https://bugzilla.mozilla.org/attachment.cgi?id=269416 from the duplicate bug 385499 shows that removeAttributeNS(null,"transform") doesn't work. Sorry about the duplicate bug!
Depends on: 320622
Depends on: 392928
Status: NEW → RESOLVED
Closed: 18 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: