Support transitions/animations of background-position with right/bottom-relative...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 2 Oct 2016 01:05:14 +0000 (01:05 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 2 Oct 2016 01:05:14 +0000 (01:05 +0000)
commita552ef70cb3358689e7541c96e905f13250d3491
tree366aaeaec82993c148ecafb6a87d825e5e3a805b
parentc79662a9464af50ce4f64949dc86b17a8b2531ed
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206713 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/shapes/shape-outside-floats/shape-outside-animation-expected.txt
LayoutTests/fast/shapes/shape-outside-floats/shape-outside-animation.html
LayoutTests/transitions/background-position-transitions-expected.txt [new file with mode: 0644]
LayoutTests/transitions/background-position-transitions.html [new file with mode: 0644]
LayoutTests/transitions/resources/transition-test-helpers.js
LayoutTests/transitions/svg-transitions-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/css/StyleBuilderConverter.h
Source/WebCore/page/animation/CSSPropertyAnimation.cpp
Source/WebCore/platform/CalculationValue.cpp
Source/WebCore/platform/CalculationValue.h
Source/WebCore/platform/Length.cpp
Source/WebCore/platform/Length.h
Source/WebCore/rendering/style/BasicShapes.cpp
Tools/TestWebKitAPI/Tests/WebCore/CalculationValue.cpp