Closed Bug 1320854 Opened 9 years ago Closed 6 years ago

CSS Transition should support non-interpolable properties animation

Categories

(Core :: CSS Parsing and Computation, defect, P3)

defect

Tracking

()

RESOLVED INVALID

People

(Reporter: daisuke, Assigned: daisuke)

References

Details

Attachments

(1 file)

Attached file sample.html
CSS Transition should animate like CSS Animation( bug 1064937 ). In attached sample html, "text-align" should change 1s later.
Blocks: 1323119
Assignee: nobody → daisuke
Now I understood what daisuke were talking about on irc. I guess you can use nsComputedStyleMap (that can be obtained by nsComputedDOMStyle::GetComputedStyleMap) and get the computed property value through it. I guess you've already done it. Right? I gues you still need nsComputedDOMStyle::SetResolvedStyleContext(const RefPtr<nsStyleContext>& aContext) instead of move. I am not sure it can be done in current nsComputedDOMStyle though.
(In reply to Hiroyuki Ikezoe (:hiro) from comment #1) > Now I understood what daisuke were talking about on irc. I guess you can > use nsComputedStyleMap (that can be obtained by > nsComputedDOMStyle::GetComputedStyleMap) and get the computed property value > through it. I guess you've already done it. Right? I gues you still need > nsComputedDOMStyle::SetResolvedStyleContext(const RefPtr<nsStyleContext>& > aContext) instead of move. I am not sure it can be done in current > nsComputedDOMStyle though. Hi Hiro, Thank you very much for the advice! At first, I had used nsComputedDOMStyle::GetPropertyValue such the following code. RefPtr<nsComputedDOMStyle> computedStyle = NS_NewComputedDOMStyle(aTargetElement, EmptyString(), shell); nsAutoString underlyingValue; computedStyle->GetPropertyValue(aProperty, underlyingValue); But, the GetPropertyValue updates the animation[1]. So added a method GetPropertyValueWithoutAnimation to avoid the update. # Also Element::GetAnimations updates too. (in case of if flush of style is needed?) I'll check GetComputedStyleMap and SetResolvedStyleContext. Also, I am fixing this in bug 1295401. Thanks again! [1]: trace to nsAnimationManager::UpdateAnimations from Element::GetAnimations #07: nsAnimationManager::UpdateAnimations(nsStyleContext*, mozilla::dom::Element*) #08: nsStyleSet::GetContext(nsStyleContext*, nsRuleNode*, nsRuleNode*, nsIAtom*, mozilla::CSSPseudoElementType, mozilla::dom::Element*, unsigned int) #09: nsStyleSet::ResolveStyleFor(mozilla::dom::Element*, nsStyleContext*, TreeMatchContext&) #10: nsStyleSet::ResolveStyleFor(mozilla::dom::Element*, nsStyleContext*) #11: nsComputedDOMStyle::GetStyleContextForElementNoFlush(mozilla::dom::Element*, nsIAtom*, nsIPresShell*, nsComputedDOMStyle::StyleType) #12: nsComputedDOMStyle::GetStyleContextForElement(mozilla::dom::Element*, nsIAtom*, nsIPresShell*, nsComputedDOMStyle::StyleType) #13: nsComputedDOMStyle::UpdateCurrentStyleSources(bool) #14: nsComputedDOMStyle::GetPropertyCSSValue(nsAString_internal const&, bool, mozilla::ErrorResult&) #15: nsComputedDOMStyle::GetPropertyValueNoFlush(nsCSSPropertyID, nsAString_internal&)
Priority: -- → P3

Marking this invalid because at some point the WG revisited this and agreed it wasn't worth the effort/risk of trying since this will almost certainly not be Web-compatible due to the prevalence of transition-property: all. If we tried to do this, we'd end up generating dozens of unintended transitions causing properties to flip at odd times, and many spurious transition events which would likely break scripts (that, upon receiving a transitionend event would assume the transition they were waiting for had finished when, in fact, it was a transition for some newly-transitionable property).

I tried to find the WG resolutions for this, but I lost access to my email archive before I had a chance to copy it so I can't find it.

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: