Bug 20908 - TransformOperations should not inherit from Vector
Summary: TransformOperations should not inherit from Vector
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Chris Marrin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-17 19:38 PDT by Dean Jackson
Modified: 2008-09-18 18:13 PDT (History)
3 users (show)

See Also:


Attachments
Patch to fix bug (32.59 KB, patch)
2008-09-18 15:26 PDT, Chris Marrin
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Jackson 2008-09-17 19:38:24 PDT
TransformOperations currently inherits from Vector. It should have a member variable instead.

Of course, it already does have a vector as a member variable, so really this whole class needs to be reworked. We should also make the difference between TransformOperation and TransformOperations clearer.
Comment 1 Dean Jackson 2008-09-17 19:39:25 PDT
and by "clearer" I mean "more clear" :)
Comment 2 Dean Jackson 2008-09-17 19:40:22 PDT
Same applies to AnimationList

Comment 3 Chris Marrin 2008-09-18 15:26:13 PDT
Created attachment 23541 [details]
Patch to fix bug
Comment 4 Chris Marrin 2008-09-18 15:26:44 PDT
I also fixed AnimationList to no longer inherit from Vector<>
Comment 5 Sam Weinig 2008-09-18 15:41:02 PDT
Comment on attachment 23541 [details]
Patch to fix bug

+    Animation* animation(size_t i) { return m_animations[i].get(); }
+    const Animation* animation(size_t i) const { return m_animations[i].get(); }
It seems like using operator[] here would be cleaner.

r=me
Comment 6 Dean Jackson 2008-09-18 17:01:42 PDT
Committed r36634
	M	WebCore/rendering/RenderLayer.cpp
	M	WebCore/rendering/style/AnimationList.cpp
	M	WebCore/rendering/style/TransformOperations.cpp
	M	WebCore/rendering/style/StyleRareNonInheritedData.cpp
	M	WebCore/rendering/style/RenderStyle.cpp
	M	WebCore/rendering/style/RenderStyle.h
	M	WebCore/rendering/style/AnimationList.h
	M	WebCore/rendering/style/TransformOperations.h
	M	WebCore/ChangeLog
	M	WebCore/css/CSSStyleSelector.cpp
	M	WebCore/css/CSSComputedStyleDeclaration.cpp
	M	WebCore/page/animation/CompositeAnimation.cpp
	M	WebCore/page/animation/KeyframeAnimation.cpp
	M	WebCore/page/animation/AnimationBase.cpp
	M	WebCore/page/animation/ImplicitAnimation.cpp

Comment 7 Simon Fraser (smfr) 2008-09-18 18:13:18 PDT
This led to some pretty ugly code. I think AnimationList and TransformOperations should have operator[] and a size() method.