Commit 59e73da2 authored by wangxianzhu's avatar wangxianzhu Committed by Commit bot

Fix wrong transform for motion-path

We call ComputedStyle::applyTransform(..., ExcludeTransformOrigin,
IncludeMotionPath, ...) in PaintPropertyTreeBuilder updateTransform().
Previously in the case applyTransform() passed wrong (0,0) origin
when calling applyMotionPathTransform().

Always pass the correct origin to applyMotionPathTransform().

BUG=652323
TEST=css3/motion-path/path-establishes-stacking-context.html with --enable-blink-features=slimmingPaintInvalidation

Review-Url: https://codereview.chromium.org/2390173002
Cr-Commit-Position: refs/heads/master@{#422970}
parent bbea865b
...@@ -1269,13 +1269,17 @@ void ComputedStyle::applyTransform( ...@@ -1269,13 +1269,17 @@ void ComputedStyle::applyTransform(
float originY = 0; float originY = 0;
float originZ = 0; float originZ = 0;
if (applyTransformOrigin) { if (applyTransformOrigin ||
// We need to calculate originX and originY for applying motion path.
applyMotionPath == ComputedStyle::IncludeMotionPath) {
originX = originX =
floatValueForLength(transformOriginX(), boundingBox.width()) + offsetX; floatValueForLength(transformOriginX(), boundingBox.width()) + offsetX;
originY = originY =
floatValueForLength(transformOriginY(), boundingBox.height()) + offsetY; floatValueForLength(transformOriginY(), boundingBox.height()) + offsetY;
originZ = transformOriginZ(); if (applyTransformOrigin) {
result.translate3d(originX, originY, originZ); originZ = transformOriginZ();
result.translate3d(originX, originY, originZ);
}
} }
if (applyIndependentTransformProperties == if (applyIndependentTransformProperties ==
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment