mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 02:14:43 +00:00
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:
parent
459a5b589b
commit
1f96bf7014
@ -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));
|
||||
|
@ -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>
|
27
layout/reftests/transform/animate-layer-scale-inherit-1.html
Normal file
27
layout/reftests/transform/animate-layer-scale-inherit-1.html
Normal 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>
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user