Bug 1760747. Ensure that the bounds on the geometry of filter items are always limited by the building rect. r=jrmuizel
There are several paths in ComputeGeometryChange where we can allocate an geometry item for a filter item, but only one path that will call DetectContainerLayerPropertiesBoundsChange (which adjusts the bounds for filter items). Make sure this always happens in ComputeGeometryChange. This was causing a bug where the geometry bounds were the full filter item height on the first paint (even though only part of the filter item was visible inside the building rect), but we did not call DetectContainerLayerPropertiesBoundsChange because it was the first paint where the filter item was visible. Then on the next paint the full filter item was visible, and there is no rect change to signal that we need to repaint. Differential Revision: https://phabricator.services.mozilla.com/D187549
This commit is contained in:
@@ -273,6 +273,8 @@ static bool DetectContainerLayerPropertiesBoundsChange(
|
||||
if (aItem->GetType() == DisplayItemType::TYPE_FILTER) {
|
||||
// Filters get clipped to the BuildingRect since they can
|
||||
// have huge bounds outside of the visible area.
|
||||
// This function and similar code in ComputeGeometryChange should be kept in
|
||||
// sync.
|
||||
aGeometry.mBounds = aGeometry.mBounds.Intersect(aItem->GetBuildingRect());
|
||||
}
|
||||
|
||||
@@ -556,6 +558,13 @@ struct DIGroup {
|
||||
}
|
||||
}
|
||||
|
||||
if (aData->mGeometry && aItem->GetType() == DisplayItemType::TYPE_FILTER) {
|
||||
// This hunk DetectContainerLayerPropertiesBoundsChange should be kept in
|
||||
// sync.
|
||||
aData->mGeometry->mBounds =
|
||||
aData->mGeometry->mBounds.Intersect(aItem->GetBuildingRect());
|
||||
}
|
||||
|
||||
mHitTestBounds.OrWith(aData->mRect);
|
||||
if (!aData->mInvisible) {
|
||||
mActualBounds.OrWith(aData->mRect);
|
||||
|
||||
Reference in New Issue
Block a user