Issue #2757: Create a new basicShape of type inset then set inset coords to zero.

This commit is contained in:
erixreyes 2025-07-08 06:08:31 +08:00 committed by roytam1
commit 67421b3048

View file

@ -10093,7 +10093,18 @@ SetStyleShapeSourceToCSSValue(
if (basicShape) {
aShapeSource->SetBasicShape(basicShape, referenceBox);
} else {
aShapeSource->SetReferenceBox(referenceBox);
if (mozilla::IsSame<ReferenceBox, StyleGeometryBox>::value &&
referenceBox != ReferenceBox::NoBox) {
RefPtr<StyleBasicShape> defaultInset = new StyleBasicShape(StyleBasicShapeType::Inset);
nsStyleCoord zero;
zero.SetCoordValue(0);
for (int i = 0; i < 4; i++) {
defaultInset->Coordinates().AppendElement(zero);
}
aShapeSource->SetBasicShape(defaultInset, referenceBox);
} else {
aShapeSource->SetReferenceBox(referenceBox);
}
}
}