Bug 1207734 - Part 4.b. Use the final combined transform in the nsDisplayTransform.
MozReview-Commit-ID: CDlvzkcae0g
--- a/layout/painting/ActiveLayerTracker.cpp
+++ b/layout/painting/ActiveLayerTracker.cpp
@@ -243,30 +243,31 @@ ActiveLayerTracker::TransferActivityToFr
aFrame->AddStateBits(NS_FRAME_HAS_LAYER_ACTIVITY_PROPERTY);
aFrame->SetProperty(LayerActivityProperty(), layerActivity);
}
static void
IncrementScaleRestyleCountIfNeeded(nsIFrame* aFrame, LayerActivity* aActivity)
{
const nsStyleDisplay* display = aFrame->StyleDisplay();
- if (!display->mSpecifiedTransform) {
+ RefPtr<nsCSSValueSharedList> transformList = display->GetCombinedTransform();
+ if (!transformList) {
// The transform was removed.
aActivity->mPreviousTransformScale = Nothing();
IncrementMutationCount(&aActivity->mRestyleCounts[LayerActivity::ACTIVITY_SCALE]);
return;
}
// Compute the new scale due to the CSS transform property.
nsPresContext* presContext = aFrame->PresContext();
RuleNodeCacheConditions dummy;
bool dummyBool;
nsStyleTransformMatrix::TransformReferenceBox refBox(aFrame);
Matrix4x4 transform =
- nsStyleTransformMatrix::ReadTransforms(display->mSpecifiedTransform->mHead,
+ nsStyleTransformMatrix::ReadTransforms(transformList->mHead,
aFrame->StyleContext(),
presContext,
dummy, refBox,
presContext->AppUnitsPerCSSPixel(),
&dummyBool);
Matrix transform2D;
if (!transform.Is2D(&transform2D)) {
// We don't attempt to handle 3D transforms; just assume the scale changed.
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -8095,17 +8095,17 @@ nsDisplayTransform::ComputePerspectiveMa
aOutMatrix.ChangeBasis(Point3D(perspectiveOrigin.x, perspectiveOrigin.y, 0));
return true;
}
nsDisplayTransform::FrameTransformProperties::FrameTransformProperties(const nsIFrame* aFrame,
float aAppUnitsPerPixel,
const nsRect* aBoundsOverride)
: mFrame(aFrame)
- , mTransformList(aFrame->StyleDisplay()->mSpecifiedTransform)
+ , mTransformList(aFrame->StyleDisplay()->GetCombinedTransform())
, mToTransformOrigin(GetDeltaToTransformOrigin(aFrame, aAppUnitsPerPixel, aBoundsOverride))
{
}
/* Wraps up the transform matrix in a change-of-basis matrix pair that
* translates from local coordinate space to transform coordinate space, then
* hands it back.
*/
--- a/layout/style/StyleAnimationValue.cpp
+++ b/layout/style/StyleAnimationValue.cpp
@@ -4631,20 +4631,21 @@ StyleAnimationValue::ExtractComputedValu
eUnit_Filter);
break;
}
case eCSSProperty_transform: {
const nsStyleDisplay *display =
static_cast<const nsStyleDisplay*>(styleStruct);
nsAutoPtr<nsCSSValueList> result;
- if (display->mSpecifiedTransform) {
+ RefPtr<nsCSSValueSharedList> transformList = display->GetCombinedTransform();
+ if (transformList) {
// Clone, and convert all lengths (not percents) to pixels.
nsCSSValueList **resultTail = getter_Transfers(result);
- for (const nsCSSValueList *l = display->mSpecifiedTransform->mHead;
+ for (const nsCSSValueList *l = transformList->mHead;
l; l = l->mNext) {
nsCSSValueList *clone = new nsCSSValueList;
*resultTail = clone;
resultTail = &clone->mNext;
SubstitutePixelValues(aStyleContext, l->mValue, clone->mValue);
}
} else {