Bug 1395476 - Do not call mStoredList.RecomputeVisibility for 3d transforms r=mattwoodrow

MozReview-Commit-ID: 1pnYL2RtFi6

--HG--
extra : rebase_source : 85699125c4b547b99ce2bf8580e0cd40720a285b
This commit is contained in:
Miko Mynttinen 2017-11-08 02:54:10 +01:00
Родитель afcd9e5c5b
Коммит 845735af56
4 изменённых файлов: 83 добавлений и 0 удалений

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

@ -8495,6 +8495,14 @@ nsDisplayTransform::GetLayerState(nsDisplayListBuilder* aBuilder,
bool nsDisplayTransform::ComputeVisibility(nsDisplayListBuilder *aBuilder, bool nsDisplayTransform::ComputeVisibility(nsDisplayListBuilder *aBuilder,
nsRegion *aVisibleRegion) nsRegion *aVisibleRegion)
{ {
// nsDisplayTransform::GetBounds() returns an empty rect in nested 3d context.
// Calling mStoredList.RecomputeVisibility below for such transform causes the
// child display items to end up with empty visible rect.
// We avoid this by bailing out always if we are dealing with a 3d context.
if (mFrame->Extend3DContext() || mFrame->Combines3DTransformWithAncestors()) {
return true;
}
/* As we do this, we need to be sure to /* As we do this, we need to be sure to
* untransform the visible rect, since we want everything that's painting to * untransform the visible rect, since we want everything that's painting to
* think that it's painting in its original rectangular coordinate space. * think that it's painting in its original rectangular coordinate space.

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

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<title>Green square</title>
<style>
.filter {
filter: brightness(0.75);
}
.container {
width: 200px;
height: 200px;
background-color: green;
}
.square {
position: absolute;
width: 200px;
height: 200px;
background-color: green;
}
</style>
</head>
<body>
<div class="filter">
<div class="container">
<div class="square"></div>
</div>
</div>
</body>
</html>

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

@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<title>Green square</title>
<style>
.filter {
filter: brightness(0.75);
}
.container {
width: 200px;
height: 200px;
transform-style: preserve-3d;
background-color: red;
}
.square {
position: absolute;
width: 200px;
height: 200px;
transform-style: preserve-3d;
background-color: green;
}
</style>
</head>
<body>
<div class="filter">
<div class="container">
<div class="square"></div>
</div>
</div>
</body>
</html>

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

@ -90,3 +90,4 @@ fuzzy-if(winWidget,150,120) == component-alpha-1.html component-alpha-1-ref.html
== nested-transform-1.html nested-transform-1-ref.html == nested-transform-1.html nested-transform-1-ref.html
== transform-geometry-1.html transform-geometry-1-ref.html == transform-geometry-1.html transform-geometry-1-ref.html
== intermediate-1.html intermediate-1-ref.html == intermediate-1.html intermediate-1-ref.html
== preserves3d-nested-filter-1.html preserves3d-nested-filter-1-ref.html