haikuwebkit/LayoutTests/transitions/background-position-transit...

8 lines
601 B
Plaintext
Raw Permalink Normal View History

[Web Animations] Implement "Starting of transitions" section from CSS Transitions https://bugs.webkit.org/show_bug.cgi?id=186517 <rdar://problem/41000798> Reviewed by Dean Jackson. LayoutTests/imported/mozilla: Mark some progressions in the Mozilla CSS Animations and CSS Transitions tests. * css-transitions/test_animation-cancel-expected.txt: * css-transitions/test_animation-ready-expected.txt: Source/WebCore: We implement the whole section at https://drafts.csswg.org/css-transitions-1/#starting so that we have spec-compliant starting of CSS Transitions. To correctly implement this we now maintain two maps of transitions for a given property, a set of running transitions (m_elementToRunningCSSTransitionByCSSPropertyID) and a set of completed transition (m_elementToCompletedCSSTransitionByCSSPropertyID). * animation/AnimationTimeline.cpp: (WebCore::removeCSSTransitionFromMap): Add a utility to remove a CSSTransition from one of the two HashMap<Element*, HashMap<CSSPropertyID, RefPtr<CSSTransition>>> managed by AnimationTimeline (m_elementToRunningCSSTransitionByCSSPropertyID and m_elementToCompletedCSSTransitionByCSSPropertyID). (WebCore::AnimationTimeline::animationWasRemovedFromElement): Use the new removeCSSTransitionFromMap() utility. (WebCore::AnimationTimeline::updateCSSAnimationsForElement): We rename "oldStyle" to "currentStyle" to align with the naming used by updateCSSAnimationsForElement(). We also remove an initial check that has been pushed up to Style::TreeResolver::createAnimatedElementUpdate(). (WebCore::propertyInStyleMatchesValueForTransitionInMap): When running the steps mandated by the spec we often need to check whether a given property has a transition in an AnimationList that matches the value used in a given RenderStyle. (WebCore::transitionCombinedDuration): We need to compute the combined duration twice while running the steps mandated by the spec, so we have a dedicated utility. (WebCore::transitionMatchesProperty): New utility that indicates whether a WebCore::Animation matches a given property, by virtue of targeting it directly, targeting a shorthand for which this property is a longhand, or targeting "all". (WebCore::AnimationTimeline::updateCSSTransitionsForElement): This is where all of the new implementation for starting transitions happens. We implement the steps as they appear in the spec. (WebCore::shouldBackingAnimationBeConsideredForCSSTransition): Deleted. * animation/AnimationTimeline.h: * animation/CSSAnimation.cpp: (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation): Since only CSS Animations respect the delay and duration values as parsed directly in a WebCore:Animation object, we move code that was previously in DeclarativeAnimation::syncPropertiesWithBackingAnimation to this method. CSS Transitions set those values based on the delay and duration parameters passed to CSSTransition::create() and computed in AnimationTimeline::updateCSSTransitionsForElement(). * animation/CSSTransition.cpp: (WebCore::CSSTransition::create): Since the transition's delay and duration is computed in AnimationTimeline::updateCSSTransitionsForElement(), we now require them to be passed when creating a CSSTransition and pass those to the new setTimingProperties() function. We also expect a target style and reversing-adjusted start style, as well as a reversing-shortening factor. (WebCore::CSSTransition::CSSTransition): (WebCore::CSSTransition::resolve): We need to be able to query the last style computed by a call to resolve() from AnimationTimeline::updateCSSTransitionsForElement(), we subclass this newly-virtual WebAnimation method and clone the style after we blended the property targeted by this transition. (WebCore::CSSTransition::setTimingProperties): Set the transition delay and duration as provided in the call to create(). (WebCore::CSSTransition::canBeListed const): Fix a crash that was found while working on this bug where we could access a null effect. (WebCore::CSSTransition::initialize): Deleted. (WebCore::CSSTransition::matchesBackingAnimationAndStyles const): Deleted. * animation/CSSTransition.h: * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::syncPropertiesWithBackingAnimation): This virtual method now has an empty definition since the timing properties are now only set for CSSAnimation. * animation/KeyframeEffectReadOnly.cpp: (WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): Deleted. * animation/KeyframeEffectReadOnly.h: * animation/WebAnimation.h: * page/animation/CSSPropertyAnimation.cpp: (WebCore::AnimationPropertyWrapperBase::canInterpolate const): Since we need to be able to determine whether some property values can be interpolated, we add a new canInterpolate() method to the base wrapper class so the cases where we can't interpolate values (length with an "auto" type) may return false. (WebCore::LengthPropertyWrapper::LengthPropertyWrapper): Lengths can only be interpolated if both the start and end values are not "auto". (WebCore::LengthVariantPropertyWrapper::LengthVariantPropertyWrapper): (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): (WebCore::CSSPropertyAnimation::canPropertyBeInterpolated): * page/animation/CSSPropertyAnimation.h: * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::createAnimatedElementUpdate): Move a check found in both updateCSSAnimationsForElement() and updateCSSTransitionsForElement() to their shared call site. LayoutTests: Implementing the CSS Transitions spec for starting transitions highlighted a couple of issues with existing tests. * TestExpectations: The test imported/mozilla/css-transitions/test_animation-ready.html now passes reliably. * animations/transition-and-animation-3-expected.txt: * animations/transition-and-animation-3.html: This test was mistakenly expecting a retargeted transition to pick up from the underlying value (100px) rather than the interrupted transition's value (~0px). We update the test to be more obvious about what it is testing and with the correct behavior per the spec. * transitions/background-position-transitions-expected.txt: * transitions/background-position-transitions.html: Shorthand properties are expected to yield a transitiong for each shorthand property, so we update this test to check the background-position shorthand properties. * transitions/resources/transition-test-helpers.js: We uncovered a crash, which is not new to this patch, that forces us to work around using the background-position longhand properties. So we work around this by reading from the shorthand background-position property and manually parsing the value. Fixing this crash is tracked by webkit.org/b/186766. * transitions/transition-to-from-auto-expected.txt: * transitions/transition-to-from-auto.html: Update the test to check that we only yield transitions when interpolating between non-auto values, as mandated by the spec. Canonical link: https://commits.webkit.org/202049@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232946 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-06-18 21:20:47 +00:00
PASS - "background-position-x" property for "box1" element at 0.5s saw something close to: 45px
PASS - "background-position-y" property for "box1" element at 0.5s saw something close to: 60px
PASS - "background-position-x" property for "box2" element at 0.5s saw something close to: 45px
PASS - "background-position-y" property for "box2" element at 0.5s saw something close to: 60px
calc() simplification for a multiplication should apply the multiplication to each value of an addition https://bugs.webkit.org/show_bug.cgi?id=224376 Reviewed by Simon Fraser. LayoutTests/imported/w3c: Mark 99 WPT progressions. * web-platform-tests/css/css-backgrounds/animations/background-position-origin-interpolation-expected.txt: * web-platform-tests/css/css-shapes/animation/shape-outside-interpolation-expected.txt: * web-platform-tests/css/css-shapes/shape-outside/values/shape-margin-003-expected.txt: * web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-circle-010-expected.txt: * web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-circle-011-expected.txt: * web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-ellipse-010-expected.txt: * web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-ellipse-011-expected.txt: * web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-008-expected.txt: * web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-inset-009-expected.txt: * web-platform-tests/css/css-shapes/shape-outside/values/shape-outside-polygon-006-expected.txt: * web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt: Source/WebCore: An expression such as calc(0.5 * (100% + 100px)) should be simplified to calc(50% + 50px). We produce these types of expressions when blending between a percentage and a dimension, and they can also be specified explicitly in style. * css/CSSCalculationValue.cpp: (WebCore::CSSCalcOperationNode::combineChildren): LayoutTests: Rebase some non-WPT tests to account for new results. * css3/calc/simplification-expected.txt: * transitions/background-position-transitions-expected.txt: * transitions/background-position-transitions.html: Canonical link: https://commits.webkit.org/236364@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275793 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-10 06:43:50 +00:00
PASS - "background-position-x" property for "box3" element at 0.5s saw something close to: calc(50% - 35px)
PASS - "background-position-y" property for "box3" element at 0.5s saw something close to: calc(50% - 40px)
Support transitions/animations of background-position with right/bottom-relative values https://bugs.webkit.org/show_bug.cgi?id=162048 Reviewed by Dean Jackson. Source/WebCore: Make transitions between "background-position: 10px 20px" and "background-position: right 10px bottom 20px" work. We do this by by converting "right 10px" to "calc(100% - 10px)" when blending. Also improve logging of calculated lengths, and better animation logging for FillLayer properties. Test: transitions/background-position-transitions.html * page/animation/CSSPropertyAnimation.cpp: (WebCore::FillLayerAnimationPropertyWrapperBase::FillLayerAnimationPropertyWrapperBase): Keep the propertyID around so logging can use it. (WebCore::FillLayerAnimationPropertyWrapperBase::property): (WebCore::FillLayerPropertyWrapperGetter::FillLayerPropertyWrapperGetter): (WebCore::FillLayerPropertyWrapperGetter::value): (WebCore::FillLayerPropertyWrapper::FillLayerPropertyWrapper): (WebCore::createCalculatedLength): (WebCore::FillLayerPositionPropertyWrapper::FillLayerPositionPropertyWrapper): (WebCore::FillLayerRefCountedPropertyWrapper::FillLayerRefCountedPropertyWrapper): (WebCore::FillLayerStyleImagePropertyWrapper::FillLayerStyleImagePropertyWrapper): (WebCore::FillLayersPropertyWrapper::FillLayersPropertyWrapper): (WebCore::CSSPropertyAnimation::blendProperties): Blend then log, so that the logging can show the result. * platform/CalculationValue.cpp: (WebCore::CalcExpressionNumber::dump): (WebCore::CalcExpressionBinaryOperation::dump): (WebCore::CalcExpressionLength::dump): (WebCore::CalcExpressionBlendLength::dump): (WebCore::operator<<): * platform/CalculationValue.h: * platform/Length.cpp: (WebCore::operator<<): LayoutTests: * transitions/background-position-transitions-expected.txt: Added. * transitions/background-position-transitions.html: Added. * transitions/resources/transition-test-helpers.js: * transitions/svg-transitions-expected.txt: Canonical link: https://commits.webkit.org/186361@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213603 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-08 23:50:43 +00:00