CSS.registerProperty cause incorrect transitions |
|||
Issue descriptionWhen registering a previously applied custom property, transitions involving that custom property animate from initialValue -> applied value. We should probably look at the previous token stream, parse it according to the new registration, and then use that for the transition.
,
May 31 2018
,
Nov 1
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/cdd3bef861f549bf2f27128cfdbeac11bfa2fc92 commit cdd3bef861f549bf2f27128cfdbeac11bfa2fc92 Author: Anders Hartvoll Ruud <andruud@chromium.org> Date: Thu Nov 01 14:51:23 2018 [css-properties-values-api] Store initial variables on ComputedStyle. Initial values are currently not stored at all on ComputedStyle, and we must refer to the PropertyRegistration to figure out what the initial value for a given property is. The problem with this, is that registering a property also has the effect of giving all styles that are already computed new values (effectively). For example, if a property '--x' is not registered (and not applied on any style), the computed value of that property is the "empty value" as described in css-variables. If the property then becomes registered, the initial value suddenly becomes whatever is specified by the registration, even on the ComputedStyle objects that already exist. This causes problems for calculating transitions, because we incorrectly consider the previous computed value to be "initialValue" from the registration rather than what it really was: "empty value". This CL adds a StyleInitialData class which contains the initial values for all registered variables. This class is instantiated for the initial style, and then referenced by all ComputedStyles that inherit from that style. This makes it possible to know what the initial value was for a certain property at the time style calculation took place. R=futhark@chromium.org Bug: 848250 Change-Id: I0a44e06608738aab15cb35fbc448a47188932600 Reviewed-on: https://chromium-review.googlesource.com/c/1309736 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Anders Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/master@{#604580} [modify] https://crrev.com/cdd3bef861f549bf2f27128cfdbeac11bfa2fc92/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/register-property.html [modify] https://crrev.com/cdd3bef861f549bf2f27128cfdbeac11bfa2fc92/third_party/blink/renderer/core/animation/css_interpolation_type.cc [modify] https://crrev.com/cdd3bef861f549bf2f27128cfdbeac11bfa2fc92/third_party/blink/renderer/core/css/computed_style_extra_fields.json5 [modify] https://crrev.com/cdd3bef861f549bf2f27128cfdbeac11bfa2fc92/third_party/blink/renderer/core/css/properties/longhands/variable.cc [modify] https://crrev.com/cdd3bef861f549bf2f27128cfdbeac11bfa2fc92/third_party/blink/renderer/core/css/resolver/css_variable_resolver.cc [modify] https://crrev.com/cdd3bef861f549bf2f27128cfdbeac11bfa2fc92/third_party/blink/renderer/core/css/resolver/style_resolver.cc [modify] https://crrev.com/cdd3bef861f549bf2f27128cfdbeac11bfa2fc92/third_party/blink/renderer/core/css/style_engine.cc [modify] https://crrev.com/cdd3bef861f549bf2f27128cfdbeac11bfa2fc92/third_party/blink/renderer/core/css/style_engine.h [modify] https://crrev.com/cdd3bef861f549bf2f27128cfdbeac11bfa2fc92/third_party/blink/renderer/core/css/style_engine_test.cc [modify] https://crrev.com/cdd3bef861f549bf2f27128cfdbeac11bfa2fc92/third_party/blink/renderer/core/style/BUILD.gn [modify] https://crrev.com/cdd3bef861f549bf2f27128cfdbeac11bfa2fc92/third_party/blink/renderer/core/style/computed_style.cc [modify] https://crrev.com/cdd3bef861f549bf2f27128cfdbeac11bfa2fc92/third_party/blink/renderer/core/style/computed_style.h [add] https://crrev.com/cdd3bef861f549bf2f27128cfdbeac11bfa2fc92/third_party/blink/renderer/core/style/style_initial_data.cc [add] https://crrev.com/cdd3bef861f549bf2f27128cfdbeac11bfa2fc92/third_party/blink/renderer/core/style/style_initial_data.h
,
Dec 11
|
|||
►
Sign in to add a comment |
|||
Comment 1 by andruud@chromium.org
, May 31 2018Status: Assigned (was: Available)