Today, I resolve style when the style sheet is read. This has several problems, most notably that it can't resolve physical units, like ems. So it needs to change. Hyatt suggests: 1) In addKeyframeStyle, just store the CSSStyleDeclarations for each keyframe 2) Create a new method (keyframeStyleForElement?) which resolves keyframes given an element and animation name 3) When starting an animation, use this method to get the list of RenderStyles for each keyframe, caching them for the duration of the animation, and using them as today to run the animation.
That's actually keyframeStylesForElement() since it collects style for all keyframes at once
Raising to P1 because of dependent bug 21043.
Created attachment 23821 [details] Patch, including LayoutTest file
The fix is as outlines above. I ended up duplicating the element's RenderStyle into each keyframe RenderStyle, so they had full information for doing things like lineheight and other font metrics (and possibly others). This makes the RenderStyles a bit more heavyweight in some cases, but I think the model is right. The submitted testcase tests the line-height property, which was borked before this change.
Comment on attachment 23821 [details] Patch, including LayoutTest file r=me
Committed r37077 M WebCore/rendering/style/KeyframeList.cpp M WebCore/rendering/style/StyleRareNonInheritedData.h M WebCore/rendering/style/StyleRareNonInheritedData.cpp M WebCore/rendering/style/Animation.h M WebCore/rendering/style/Animation.cpp M WebCore/rendering/style/KeyframeList.h M WebCore/rendering/style/RenderStyle.h M WebCore/ChangeLog M WebCore/css/CSSStyleSelector.cpp M WebCore/css/CSSStyleSelector.h M WebCore/page/animation/CompositeAnimation.cpp M WebCore/page/animation/KeyframeAnimation.cpp M WebCore/page/animation/KeyframeAnimation.h M LayoutTests/ChangeLog A LayoutTests/animations/lineheight-animation.html A LayoutTests/animations/lineheight-animation-expected.txt r37077 = e979de02d997b41646bbf7c704ca6bc0c6c3bfdb (trunk)
*** Bug 20148 has been marked as a duplicate of this bug. ***