From 6a2e242d0cf474aa7a1114ced6ccc4d740fb772e Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Tue, 9 Sep 2014 17:14:47 +0200 Subject: [PATCH] Bug 1062870 - Restore the post-filter dirtyRect after building the filtered display items. r=roc --- layout/generic/nsFrame.cpp | 6 ++++- layout/reftests/bugs/1059498-2.html | 40 ++++++++++++++++++++++++++++ layout/reftests/bugs/1059498-3.html | 41 +++++++++++++++++++++++++++++ layout/reftests/bugs/reftest.list | 2 ++ 4 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 layout/reftests/bugs/1059498-2.html create mode 100644 layout/reftests/bugs/1059498-3.html diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index a72cb8eea925..74a37847e07b 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -1936,6 +1936,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder, AutoSaveRestoreBlendMode autoRestoreBlendMode(*aBuilder); aBuilder->SetContainsBlendModes(BlendModeSet()); + nsRect dirtyRectOutsideTransform = dirtyRect; if (isTransformed) { const nsRect overflow = GetVisualOverflowRectRelativeToSelf(); if (aBuilder->IsForPainting() && @@ -1960,6 +1961,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder, } bool usingSVGEffects = nsSVGIntegrationUtils::UsingEffectsForFrame(this); + nsRect dirtyRectOutsideSVGEffects = dirtyRect; if (usingSVGEffects) { dirtyRect = nsSVGIntegrationUtils::GetRequiredSourceForInvalidArea(this, dirtyRect); @@ -2082,6 +2084,8 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder, * output even if the element being filtered wouldn't otherwise do so. */ if (usingSVGEffects) { + // Revert to the post-filter dirty rect. + buildingDisplayList.SetDirtyRect(dirtyRectOutsideSVGEffects); /* List now emptied, so add the new list to the top. */ resultList.AppendNewToTop( new (aBuilder) nsDisplaySVGEffects(aBuilder, this, &resultList)); @@ -2116,7 +2120,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder, clipState.Restore(); // Revert to the dirtyrect coming in from the parent, without our transform // taken into account. - buildingDisplayList.SetDirtyRect(aDirtyRect); + buildingDisplayList.SetDirtyRect(dirtyRectOutsideTransform); // Revert to the outer reference frame and offset because all display // items we create from now on are outside the transform. const nsIFrame* outerReferenceFrame = diff --git a/layout/reftests/bugs/1059498-2.html b/layout/reftests/bugs/1059498-2.html new file mode 100644 index 000000000000..f0bddaec92a6 --- /dev/null +++ b/layout/reftests/bugs/1059498-2.html @@ -0,0 +1,40 @@ + + + +Test for bug 1059498 - Paint parts of the filter that are caused by parts of the source that are invisible + + + +
+
+
+ + + + + + + + diff --git a/layout/reftests/bugs/1059498-3.html b/layout/reftests/bugs/1059498-3.html new file mode 100644 index 000000000000..e287f53f6522 --- /dev/null +++ b/layout/reftests/bugs/1059498-3.html @@ -0,0 +1,41 @@ + + + +Test for bug 1059498 - Paint parts of the filter that are caused by parts of the source that are invisible + + + +
+
+
+ + + + + + + + diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index 5392f693e69b..143fed00678c 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -1831,3 +1831,5 @@ pref(browser.display.use_document_fonts,0) == 1022481-1.html 1022481-1-ref.html test-pref(layout.css.grid.enabled,true) == 1053035-1-grid.html 1053035-1-ref.html == 1059167-1.html 1059167-1-ref.html == 1059498-1.html 1059498-1-ref.html +== 1059498-2.html 1059498-1-ref.html +== 1059498-3.html 1059498-1-ref.html