Bug 1122526 patch 1 - Factor in the scale from ancestors when computing scale for layer with OMT animation of transform. r=roc

This commit is contained in:
L. David Baron 2015-06-29 16:46:16 -07:00
parent 459a5b589b
commit 1f96bf7014
4 changed files with 58 additions and 0 deletions

View File

@ -4700,9 +4700,14 @@ ChooseScaleAndSetTransform(FrameLayerBuilder* aLayerBuilder,
if (aContainerFrame->GetContent() &&
nsLayoutUtils::HasAnimationsForCompositor(
aContainerFrame->GetContent(), eCSSProperty_transform)) {
// compute scale using the animation on the container (ignoring
// its ancestors)
scale = nsLayoutUtils::ComputeSuitableScaleForAnimation(
aContainerFrame->GetContent(), aVisibleRect.Size(),
aContainerFrame->PresContext()->GetVisibleArea().Size());
// multiply by the scale inherited from ancestors
scale.width *= aIncomingScale.mXScale;
scale.height *= aIncomingScale.mYScale;
} else {
// Scale factors are normalized to a power of 2 to reduce the number of resolution changes
scale = RoundToFloatPrecision(ThebesMatrix(transform2d).ScaleFactors(true));

View File

@ -0,0 +1,24 @@
<!DOCTYPE HTML>
<title>Testcase, bug 1122526</title>
<style>
#outer, #inner {
display: inline-block;
background: white;
color: black;
}
#inner {
vertical-align: top;
height: 100px;
width: 100px;
background: repeating-linear-gradient(to top left, yellow, blue 10px);
will-change: transform;
}
</style>
<div id="outer">
<div id="inner">
</div>
</div>

View File

@ -0,0 +1,27 @@
<!DOCTYPE HTML>
<title>Testcase, bug 1122526</title>
<style>
#outer, #inner {
display: inline-block;
background: white;
color: black;
}
#outer { transform: scale(5) }
#inner { animation: HoldTransform linear infinite 1s }
#inner {
vertical-align: top;
height: 100px;
width: 100px;
background: repeating-linear-gradient(to top left, yellow, blue 10px);
}
@keyframes HoldTransform {
from, to { transform: scale(0.2) }
}
</style>
<div id="outer">
<div id="inner">
</div>
</div>

View File

@ -132,3 +132,5 @@ pref(svg.transform-origin.enabled,true) == transform-origin-svg-1a.svg transform
pref(svg.transform-origin.enabled,true) == transform-origin-svg-1b.svg transform-origin-svg-1-ref.svg
pref(svg.transform-origin.enabled,true) == transform-origin-svg-2a.svg transform-origin-svg-2-ref.svg
pref(svg.transform-origin.enabled,true) == transform-origin-svg-2b.svg transform-origin-svg-2-ref.svg
# Bug 1122526
== animate-layer-scale-inherit-1.html animate-layer-scale-inherit-1-ref.html