| 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 935bc431515c0bc859e42937d60581a679ff7a8a..e8ab70766da7183d3ff9104b0821bb5cec3e8710 100644
|
| --- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
|
| +++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
|
| @@ -1344,7 +1344,7 @@ void ComputedStyle::applyTransform(
|
| }
|
|
|
| if (applyMotionPath == ComputedStyle::IncludeMotionPath)
|
| - applyMotionPathTransform(originX, originY, result);
|
| + applyMotionPathTransform(originX, originY, boundingBox, result);
|
|
|
| const Vector<RefPtr<TransformOperation>>& transformOperations =
|
| transform().operations();
|
| @@ -1360,11 +1360,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;
|
| }
|
| @@ -1387,8 +1387,25 @@ void ComputedStyle::applyMotionPathTransform(
|
| if (motionData.m_rotation.type == OffsetRotationFixed)
|
| angle = 0;
|
|
|
| - transform.translate(point.x() - originX, point.y() - originY);
|
| + float originShiftX = 0;
|
| + float originShiftY = 0;
|
| + if (RuntimeEnabledFeatures::cssOffsetPositionAnchorEnabled()) {
|
| + // TODO(ericwilligers): crbug.com/638055 Support offset-anchor: auto.
|
| + 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() - originX + originShiftX,
|
| + point.y() - originY + originShiftY);
|
| transform.rotate(angle + motionData.m_rotation.angle);
|
| +
|
| + if (RuntimeEnabledFeatures::cssOffsetPositionAnchorEnabled()) {
|
| + transform.translate(-originShiftX, -originShiftY);
|
| + }
|
| }
|
|
|
| void ComputedStyle::setTextShadow(PassRefPtr<ShadowList> s) {
|
|
|