Closed Bug 508496 Opened 15 years ago Closed 15 years ago

SVG: SVGAnimatedLength's animVal and baseVal attributes always return different objects

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: birtles, Assigned: birtles)

References

()

Details

Attachments

(1 file, 4 obsolete files)

If you request the baseVal attribute of an animated length twice and compare the two objects (with ===) they will be different objects. This seems wrong. You should get back the same object so that width.baseVal === width.baseVal. The same problem occurs for animVal as well. We return a new object every time. This was originally raised in bug 506856 but is now being split off into a separate bug because it's quite unrelated to readonly behaviour (which is what bug 506856 deals with) and it might take quite a bit of work. See discussion on www-svg: http://lists.w3.org/Archives/Public/www-svg/2008Sep/0023.html
Attached patch proposed patch v1a (obsolete) — Splinter Review
First attempt at a patch to address this.
Assignee: nobody → birtles
Status: NEW → ASSIGNED
Attached patch patch v1b (obsolete) — Splinter Review
Fixed a permissions bug in test case that caused it to fail on TryServer.
Attachment #394424 - Attachment is obsolete: true
Attachment #395180 - Flags: superreview?(roc)
Attachment #395180 - Flags: review?(roc)
Attachment #395180 - Flags: superreview?(roc)
Attachment #395180 - Flags: review?(roc)
Attachment #395180 - Flags: review+
Comment on attachment 395180 [details] [diff] [review] patch v1b Is there no better way to detect that SMIL is disabled? That's a bit disturbing if true. + TearoffType* + GetTearoff(SimpleType* aSimple); + + void + AddTearoff(SimpleType* aSimple, TearoffType* aTearoff); + + void + RemoveTearoff(SimpleType* aSimple); One line each I suggest adding a destructor to nsSVGAttrTearoffTable which asserts that the hashtable is empty. r+ with those changes
Will give it another run on TryServer before marking checkin-needed.
Attachment #395180 - Attachment is obsolete: true
Keywords: checkin-needed
Attached patch patch v1d (obsolete) — Splinter Review
Removed querying of preferences from test case.
Attachment #396263 - Attachment is obsolete: true
Although I don't understand how this test works. There will always be an element with id 'animate'. The question is whether it exports the <animate> element's DOM interface.
Attached patch patch v1eSplinter Review
Updated check for whether SMIL is enabled. It turns out, and I haven't tracked down exactly why, but getElementById doesn't pick up <animate> elements with ids when SMIL is not enabled. Anyway, in case that behaviour changes, I've also made it test for an SVGAnimationElement interface property: targetElement.
Attachment #396522 - Attachment is obsolete: true
I've got this on the try server now. Previous tryserver run produced warnings that I think are ok but I want to run it again to be sure. Will add checkin-needed when done.
All good on TryServer.
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: