Backed out changeset 1a8f6cac81c5 (bug 1582810) for reftest failures in img-widthAndHeight-slice-1.html on a CLOSED TREE

This commit is contained in:
Oana Pop Rus 2019-09-20 23:35:45 +03:00
Родитель 9dbf00c709
Коммит fb8920ea20
2 изменённых файлов: 30 добавлений и 0 удалений

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

@ -1440,6 +1440,16 @@ void WebRenderCommandBuilder::DoGroupingForDisplayList(
bool snapped;
nsRect groupBounds =
aWrappingItem->GetUntransformedBounds(aDisplayListBuilder, &snapped);
// We don't want to restrict the size of the blob to the building rect of the
// display item, since that will change when we scroll and trigger a resize
// invalidation of the blob (will be fixed by blob recoordination).
// Instead we retrieve the bounds of the overflow clip on the <svg> and use
// that to restrict our size and prevent invisible content from affecting
// our bounds.
if (mClippedGroupBounds) {
groupBounds = groupBounds.Intersect(mClippedGroupBounds.value());
mClippedGroupBounds = Nothing();
}
DIGroup& group = groupData->mSubGroup;
gfx::Size scale = aSc.GetInheritedScale();
@ -1750,6 +1760,25 @@ void WebRenderCommandBuilder::CreateWebRenderCommandsFromDisplayList(
// animated geometry root, so we can combine subsequent items of that
// type into the same image.
mContainsSVGGroup = mDoGrouping = true;
if (aWrappingItem &&
aWrappingItem->GetType() == DisplayItemType::TYPE_TRANSFORM) {
// Inline <svg> should always have an overflow clip, but it gets put
// outside the nsDisplayTransform we create for scaling the svg
// viewport. Converting the clip into inner coordinates lets us
// restrict the size of the blob images and prevents unnecessary
// resizes.
nsDisplayTransform* transform =
static_cast<nsDisplayTransform*>(aWrappingItem);
nsRect clippedBounds =
transform->GetClippedBounds(aDisplayListBuilder);
nsRect innerClippedBounds;
DebugOnly<bool> result = transform->UntransformRect(
aDisplayListBuilder, clippedBounds, &innerClippedBounds);
MOZ_ASSERT(result);
mClippedGroupBounds = Some(innerClippedBounds);
}
GP("attempting to enter the grouping code\n");
}

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

@ -260,6 +260,7 @@ class WebRenderCommandBuilder final {
// Whether consecutive inactive display items should be grouped into one
// blob image.
bool mDoGrouping;
Maybe<nsRect> mClippedGroupBounds;
// True if the most recently build display list contained an svg that
// we did grouping for.