From ce2015a790cb57cf9852ff97ece6b03b85445adc Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Mon, 29 Mar 2010 14:46:58 +1300 Subject: [PATCH] Bug 545049. When the overflow area of a transformed frame changes, we need to repaint the whole thing. r=mats --- layout/generic/nsFrame.cpp | 14 ++++++++------ layout/reftests/bugs/545049-1-ref.html | 9 +++++++++ layout/reftests/bugs/545049-1.html | 16 ++++++++++++++++ layout/reftests/bugs/reftest.list | 7 ++++--- 4 files changed, 37 insertions(+), 9 deletions(-) create mode 100644 layout/reftests/bugs/545049-1-ref.html create mode 100644 layout/reftests/bugs/545049-1.html diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 39a1726a69c..ee4898895ac 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -5662,8 +5662,10 @@ nsIFrame::FinishAndStoreOverflow(nsRect* aOverflowArea, nsSize aNewSize) &hasOutlineOrEffects); /* If we're transformed, transform the overflow rect by the current transformation. */ - if ((mState & NS_FRAME_MAY_BE_TRANSFORMED_OR_HAVE_RENDERING_OBSERVERS) && - GetStyleDisplay()->HasTransform()) { + PRBool hasTransform = + (mState & NS_FRAME_MAY_BE_TRANSFORMED_OR_HAVE_RENDERING_OBSERVERS) && + GetStyleDisplay()->HasTransform(); + if (hasTransform) { /* Since our size might not actually have been computed yet, we need to make sure that we use the * correct dimensions by overriding the stored bounding rectangle with the value the caller has * ensured us we'll use. @@ -5687,10 +5689,10 @@ nsIFrame::FinishAndStoreOverflow(nsRect* aOverflowArea, nsSize aNewSize) } } - if (overflowChanged && hasOutlineOrEffects) { - // When there's an outline or box-shadow or SVG effects, changes to - // those styles might require repainting of the old and new overflow - // areas. Repainting of the old overflow area is handled in + if (overflowChanged && (hasOutlineOrEffects || hasTransform)) { + // When there's an outline or box-shadow or SVG effects or transform, + // changes to those styles might require repainting of the old and new + // overflow areas. Repainting of the old overflow area is handled in // nsCSSFrameConstructor::DoApplyRenderingChangeToTree in response // to nsChangeHint_RepaintFrame. Since the new overflow area is not // known at that time, we have to handle it here. diff --git a/layout/reftests/bugs/545049-1-ref.html b/layout/reftests/bugs/545049-1-ref.html new file mode 100644 index 00000000000..8c2bb7eccb0 --- /dev/null +++ b/layout/reftests/bugs/545049-1-ref.html @@ -0,0 +1,9 @@ + + + + + +
+
+ + diff --git a/layout/reftests/bugs/545049-1.html b/layout/reftests/bugs/545049-1.html new file mode 100644 index 00000000000..521745bbc0d --- /dev/null +++ b/layout/reftests/bugs/545049-1.html @@ -0,0 +1,16 @@ + + + + + +
+
+ + + diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index 006137edeb1..3e5d733a37e 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -1408,10 +1408,11 @@ fails HTTP(..) == 518172-2b.html 518172-b-ref.html # bug 518172 == 539323-1.html 539323-1-ref.html == 539323-2.html 539323-2-ref.html == 539323-3.html 539323-3-ref.html -== 542620-1.html 542620-1-ref.html == 541382-1.html 541382-1-ref.html random-if(!haveTestPlugin) == 541406-1.html 541406-1-ref.html +== 542620-1.html 542620-1-ref.html +== 545049-1.html 545049-1-ref.html == 546033-1.html 546033-1-ref.html -== 550716-1.html 550716-1-ref.html -== 549184-1.html 549184-1-ref.html random-if(!haveTestPlugin) == 546071-1.html 546071-1-ref.html +== 549184-1.html 549184-1-ref.html +== 550716-1.html 550716-1-ref.html