Bug 18473 - Animation <use> fixes
Summary: Animation <use> fixes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-14 00:18 PDT by Antti Koivisto
Modified: 2008-04-14 16:58 PDT (History)
2 users (show)

See Also:


Attachments
<use> fixes (10.47 KB, patch)
2008-04-14 00:19 PDT, Antti Koivisto
eric: review-
Details | Formatted Diff | Diff
added comment and assert to removeDisallowedElementsFromSubtree() (10.75 KB, patch)
2008-04-14 16:03 PDT, Antti Koivisto
no flags Details | Formatted Diff | Diff
...and rename the requested variable (10.77 KB, patch)
2008-04-14 16:07 PDT, Antti Koivisto
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2008-04-14 00:18:59 PDT
Animations should not be cloned to instance trees etc.
Comment 1 Antti Koivisto 2008-04-14 00:19:33 PDT
Created attachment 20522 [details]
<use> fixes
Comment 2 Eric Seidel (no email) 2008-04-14 07:46:31 PDT
I guess setInstanceUpdatesBlocked isn't used?
Comment 3 Antti Koivisto 2008-04-14 09:46:10 PDT
Not yet. I need it for the next patch that does additive animations and <use> properly. I added it here that keep that one bit smaller.
Comment 4 Eric Seidel (no email) 2008-04-14 13:56:22 PDT
Comment on attachment 20522 [details]
<use> fixes

I prefer arguments to have more informative names than "b":
setInstanceUpdatesBlocked
"blockUpdates" perhaps?

Is gElementsWithInstanceUpdatesBlocked the official pattern now? I thought s_ was?

 void SVGUseElement::removeDisallowedElementsFromSubtree(Node* element)

needs a comment as to why RefPtr<Node> is not required to protect against MutationEvent listeners doing bad things.

+bool SVGSMILElement::isSMILElement(Node* node)
I'm surprised that's even needed.  I guess I would have figured there would have been a virtual bool isSVGSMILElement() const { return false; } on SVGElement.

r- due to the possible crasher due to mutation events (or lack of comment)
Comment 5 Antti Koivisto 2008-04-14 16:03:25 PDT
Created attachment 20537 [details]
added comment and assert to removeDisallowedElementsFromSubtree()

no code changes
Comment 6 Antti Koivisto 2008-04-14 16:07:08 PDT
Created attachment 20538 [details]
...and rename the requested variable
Comment 7 Antti Koivisto 2008-04-14 16:11:37 PDT
(In reply to comment #4)

> Is gElementsWithInstanceUpdatesBlocked the official pattern now? I thought s_
> was?

s_ is for static member variables only.

> needs a comment as to why RefPtr<Node> is not required to protect against
> MutationEvent listeners doing bad things.

The subtree is not in document so mutation events won't happen. Added assert and comment.

Generally using RefPtr<> in this kind of places is bad idea since it is a) slow, b) hides bugs.

> 
> +bool SVGSMILElement::isSMILElement(Node* node)
> I'm surprised that's even needed.  I guess I would have figured there would
> have been a virtual bool isSVGSMILElement() const { return false; } on
> SVGElement.

That might be good to add as well, but this kind of interface has advantage of being usable without casting for Node*'s.
Comment 8 Eric Seidel (no email) 2008-04-14 16:17:10 PDT
Comment on attachment 20538 [details]
...and rename the requested variable

r=me
Comment 9 Antti Koivisto 2008-04-14 16:58:06 PDT
Sending        WebCore/ChangeLog
Sending        WebCore/svg/SVGAElement.cpp
Sending        WebCore/svg/SVGElementInstance.cpp
Sending        WebCore/svg/SVGStyledElement.cpp
Sending        WebCore/svg/SVGStyledElement.h
Sending        WebCore/svg/SVGUseElement.cpp
Sending        WebCore/svg/SVGUseElement.h
Sending        WebCore/svg/animation/SVGSMILElement.cpp
Sending        WebCore/svg/animation/SVGSMILElement.h
Transmitting file data .........
Committed revision 31891.