Bug 1449640. Don't compute a scale for 3d transformed content. r=kats

This matches the behaviour of ChooseScaleAndSetTransform()

MozReview-Commit-ID: LxtkQn2XdYT

--HG--
extra : rebase_source : 9d2a9b1af9bf039def408f86982da835b7120e36
This commit is contained in:
Jeff Muizelaar 2018-03-27 17:46:34 -04:00
Родитель 8ffa5ed1e3
Коммит 2fd17450bb
4 изменённых файлов: 72 добавлений и 2 удалений

Просмотреть файл

@ -16,6 +16,7 @@ StackingContextHelper::StackingContextHelper()
: mBuilder(nullptr)
, mScale(1.0f, 1.0f)
, mAffectsClipPositioning(false)
, mIsPreserve3D(false)
{
// mOrigin remains at 0,0
}
@ -36,10 +37,14 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
: mBuilder(&aBuilder)
, mScale(1.0f, 1.0f)
, mTransformForScrollData(aTransformForScrollData)
, mIsPreserve3D(aIsPreserve3D)
{
// Compute scale for fallback rendering.
// Compute scale for fallback rendering. We don't try to guess a scale for 3d
// transformed items
gfx::Matrix transform2d;
if (aBoundTransform && aBoundTransform->CanDraw2D(&transform2d)) {
if (aBoundTransform && aBoundTransform->CanDraw2D(&transform2d)
&& !aPerspectivePtr
&& !aParentSC.mIsPreserve3D) {
mInheritedTransform = transform2d * aParentSC.mInheritedTransform;
mScale = mInheritedTransform.ScaleFactors(true);
}

Просмотреть файл

@ -85,6 +85,7 @@ private:
gfx::Matrix mInheritedTransform;
bool mAffectsClipPositioning;
Maybe<gfx::Matrix4x4> mTransformForScrollData;
bool mIsPreserve3D;
};
} // namespace layers

Просмотреть файл

@ -0,0 +1,63 @@
<!DOCTYPE html>
<html>
<style>
svg{
display: block;
margin: auto;
-webkit-transform-origin: top center;
-webkit-transform: scale(1.5);
}
#cube{
position: absolute;
left: 25px;
top: 25px;
width: 74px;
height: 74px;
backface-visibility: visible;
-webkit-transform-style: preserve-3d;
-webkit-transform-origin: center center;
-webkit-backface-visibility: visible;
-webkit-transform: rotateX(-45deg) rotateY(50deg);
-webkit-transition: -webkit-transform 1s;
}
.side{
position: absolute;
top: 0;
left: 0;
width: 74px;
height: 74px;
backface-visibility: visible;
-webkit-transform-origin: center center;
-webkit-backface-visibility: visible;
}
#cube .side:nth-child(1) {
-webkit-transform: translateY(37px) rotateX(90deg);
-moz-transform: translateY(37px) rotateX(90deg);
}
#cube .side:nth-child(2) {
-webkit-transform: translateY(-37px) rotateX(-90deg);
-moz-transform: translateY(-37px) rotateX(-90deg);
}
</style>
</head>
<body>
<div id="cube">
<svg class="side" width="100px" height="100px">
<rect fill="#DAD6CC" width="74" height="74"></rect>
<circle fill="#F8F1E5" cx="37" cy="37" r="27"></circle>
<g>
</g>
</svg>
<svg class="side" width="100px" height="100px">
<rect fill="#DAD6CC" width="74" height="74"></rect>
<circle fill="#F8F1E5" cx="37" cy="37" r="27"></circle>
<g>
</g>
</svg>
</div>
</body></html>

Просмотреть файл

@ -91,3 +91,4 @@ fuzzy-if(winWidget,150,120) == component-alpha-1.html component-alpha-1-ref.html
== transform-geometry-1.html transform-geometry-1-ref.html
== intermediate-1.html intermediate-1-ref.html
== preserves3d-nested-filter-1.html preserves3d-nested-filter-1-ref.html
!= preserve3d-scale.html about:blank