Bug 1062870 - Restore the post-filter dirtyRect after building the filtered display items. r=roc

This commit is contained in:
Markus Stange 2014-09-09 17:14:47 +02:00
Родитель 18e617e6e4
Коммит 6a2e242d0c
4 изменённых файлов: 88 добавлений и 1 удалений

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

@ -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 =

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

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>Test for bug 1059498 - Paint parts of the filter that are caused by parts of the source that are invisible</title>
<style>
body {
margin: 0;
}
#filtered {
margin-top: -110px;
margin-left: -10px;
width: 100px;
height: 100px;
background-color: white;
filter: url(#filter);
}
#transformed {
transform: translateX(10px);
width: 200px;
}
</style>
<div id="transformed">
<div id="filtered"></div>
</div>
<svg height="0">
<defs>
<filter id="filter" filterUnits="objectBoundingBox"
x="0%" y="0%" width="100%" height="200%"
color-interpolation-filters="sRGB">
<feDropShadow stdDeviation="0" dx="0" dy="40" flood-color="lime"/>
</filter>
</defs>
</svg>

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

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>Test for bug 1059498 - Paint parts of the filter that are caused by parts of the source that are invisible</title>
<style>
body {
margin: 0;
}
#filtered {
margin-top: -150px;
margin-left: -10px;
width: 100px;
height: 100px;
background-color: white;
filter: url(#filter);
transform: translateY(40px);
}
#transformed {
transform: translateX(10px);
width: 200px;
}
</style>
<div id="transformed">
<div id="filtered"></div>
</div>
<svg height="0">
<defs>
<filter id="filter" filterUnits="objectBoundingBox"
x="0%" y="0%" width="100%" height="200%"
color-interpolation-filters="sRGB">
<feDropShadow stdDeviation="0" dx="0" dy="40" flood-color="lime"/>
</filter>
</defs>
</svg>

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

@ -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