| Index: third_party/WebKit/Source/core/style/ComputedStyle.cpp
|
| diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
|
| index 7fbcc82f295c4fe5a9262d0c67c628545fcaa9f0..5b4135b3f46794aa00b66ae1f51a1826a022222c 100644
|
| --- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
|
| +++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
|
| @@ -1324,7 +1324,7 @@ void ComputedStyle::applyTransform(
|
| }
|
|
|
| if (applyMotionPath == ComputedStyle::IncludeMotionPath)
|
| - applyMotionPathTransform(originX, originY, result);
|
| + applyMotionPathTransform(boundingBox, result);
|
|
|
| const Vector<RefPtr<TransformOperation>>& transformOperations =
|
| transform().operations();
|
| @@ -1338,13 +1338,11 @@ void ComputedStyle::applyTransform(
|
| }
|
|
|
| void ComputedStyle::applyMotionPathTransform(
|
| - float originX,
|
| - float originY,
|
| + const FloatRect& boundingBox,
|
| TransformationMatrix& transform) const {
|
| const StyleMotionData& motionData =
|
| m_rareNonInheritedData->m_transform->m_motion;
|
| - // TODO(ericwilligers): crbug.com/638055 Apply offset-position and
|
| - // offset-anchor.
|
| + // TODO(ericwilligers): crbug.com/638055 Apply offset-position.
|
| if (!motionData.m_path) {
|
| return;
|
| }
|
| @@ -1367,8 +1365,27 @@ void ComputedStyle::applyMotionPathTransform(
|
| if (motionData.m_rotation.type == OffsetRotationFixed)
|
| angle = 0;
|
|
|
| - transform.translate(point.x() - originX, point.y() - originY);
|
| + float offsetX = transformOriginX().type() == Percent ? boundingBox.x() : 0;
|
| + float offsetY = transformOriginY().type() == Percent ? boundingBox.y() : 0;
|
| +
|
| + float originShiftX = 0;
|
| + float originShiftY = 0;
|
| + if (RuntimeEnabledFeatures::cssOffsetPositionAnchorEnabled()) {
|
| + const LengthPoint& anchor = offsetAnchor();
|
| + originShiftX = floatValueForLength(anchor.x(), boundingBox.width()) -
|
| + floatValueForLength(transformOriginX(), boundingBox.width());
|
| + originShiftY =
|
| + floatValueForLength(anchor.y(), boundingBox.height()) -
|
| + floatValueForLength(transformOriginY(), boundingBox.height());
|
| + }
|
| +
|
| + transform.translate(point.x() - offsetX + originShiftX,
|
| + point.y() - offsetY + originShiftY);
|
| transform.rotate(angle + motionData.m_rotation.angle);
|
| +
|
| + if (RuntimeEnabledFeatures::cssOffsetPositionAnchorEnabled()) {
|
| + transform.translate(-originShiftX, -originShiftY);
|
| + }
|
| }
|
|
|
| void ComputedStyle::setTextShadow(PassRefPtr<ShadowList> s) {
|
|
|