diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 77f1a8bbf69b..31719e6b3303 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -1985,7 +1985,7 @@ nsRect nsDisplayTransform::GetBounds(nsDisplayListBuilder *aBuilder) } /* The transform is opaque iff the transform consists solely of scales and - * transforms and if the underlying content is opaque. Thus if the transform + * translations and if the underlying content is opaque. Thus if the transform * is of the form * * |a c e| @@ -1993,6 +1993,12 @@ nsRect nsDisplayTransform::GetBounds(nsDisplayListBuilder *aBuilder) * |0 0 1| * * We need b and c to be zero. + * + * We also need to check whether the underlying opaque content completely fills + * our visible rect. We use UntransformRect which expands to the axis-aligned + * bounding rect, but that's OK since if + * mStoredList.GetVisibleRect().Contains(untransformedVisible), then it + * certainly contains the actual (non-axis-aligned) untransformed rect. */ PRBool nsDisplayTransform::IsOpaque(nsDisplayListBuilder *aBuilder, PRBool* aForceTransparentSurface) @@ -2001,8 +2007,11 @@ PRBool nsDisplayTransform::IsOpaque(nsDisplayListBuilder *aBuilder, *aForceTransparentSurface = PR_FALSE; } const nsStyleDisplay* disp = mFrame->GetStyleDisplay(); + nsRect untransformedVisible = + UntransformRect(mVisibleRect, mFrame, ToReferenceFrame()); return disp->mTransform.GetMainMatrixEntry(1) == 0.0f && disp->mTransform.GetMainMatrixEntry(2) == 0.0f && + mStoredList.GetVisibleRect().Contains(untransformedVisible) && mStoredList.IsOpaque(aBuilder); } @@ -2013,8 +2022,11 @@ PRBool nsDisplayTransform::IsOpaque(nsDisplayListBuilder *aBuilder, PRBool nsDisplayTransform::IsUniform(nsDisplayListBuilder *aBuilder, nscolor* aColor) { const nsStyleDisplay* disp = mFrame->GetStyleDisplay(); + nsRect untransformedVisible = + UntransformRect(mVisibleRect, mFrame, ToReferenceFrame()); return disp->mTransform.GetMainMatrixEntry(1) == 0.0f && disp->mTransform.GetMainMatrixEntry(2) == 0.0f && + mStoredList.GetVisibleRect().Contains(untransformedVisible) && mStoredList.IsUniform(aBuilder, aColor); } diff --git a/layout/reftests/transform/601894-1.html b/layout/reftests/transform/601894-1.html new file mode 100644 index 000000000000..28af1fa2844f --- /dev/null +++ b/layout/reftests/transform/601894-1.html @@ -0,0 +1,20 @@ + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/layout/reftests/transform/601894-2.html b/layout/reftests/transform/601894-2.html new file mode 100644 index 000000000000..7bf87215b210 --- /dev/null +++ b/layout/reftests/transform/601894-2.html @@ -0,0 +1,8 @@ + + + +
+
+
+ + diff --git a/layout/reftests/transform/601894-ref.html b/layout/reftests/transform/601894-ref.html new file mode 100644 index 000000000000..f4e6cdae83c8 --- /dev/null +++ b/layout/reftests/transform/601894-ref.html @@ -0,0 +1,2 @@ + + diff --git a/layout/reftests/transform/reftest.list b/layout/reftests/transform/reftest.list index b8c690aace5c..ca40837957d0 100644 --- a/layout/reftests/transform/reftest.list +++ b/layout/reftests/transform/reftest.list @@ -105,3 +105,6 @@ fails-if(d2d) == abspos-1d.html abspos-1-ref.html == propagate-inherit-boolean.html propagate-inherit-boolean-ref.html # Ensure you can't move outside an iframe == iframe-1.html iframe-1-ref.html +# Bugs +== 601894-1.html 601894-ref.html +== 601894-2.html 601894-ref.html