Bug 1455453 - Coalesce calls to mFrame->StyleDisplay() in FloatInfo constructor.
MozReview-Commit-ID: 2tdsttkO6ig
--- a/layout/generic/nsFloatManager.cpp
+++ b/layout/generic/nsFloatManager.cpp
@@ -2381,35 +2381,36 @@ nsFloatManager::FloatInfo::FloatInfo(nsI
// margin box. Therefore, no need to create a shape info if the float's
// margin box is empty, since a float area can only be smaller than the
// margin box.
// https://drafts.csswg.org/css-shapes/#relation-to-box-model-and-float-behavior
return;
}
- const StyleShapeSource& shapeOutside = mFrame->StyleDisplay()->mShapeOutside;
+ const nsStyleDisplay* styleDisplay = mFrame->StyleDisplay();
+ const StyleShapeSource& shapeOutside = styleDisplay->mShapeOutside;
nscoord shapeMargin = (shapeOutside.GetType() == StyleShapeSourceType::None)
? 0
: nsLayoutUtils::ResolveToLength<true>(
- mFrame->StyleDisplay()->mShapeMargin,
+ styleDisplay->mShapeMargin,
LogicalSize(aWM, aContainerSize).ISize(aWM));
switch (shapeOutside.GetType()) {
case StyleShapeSourceType::None:
// No need to create shape info.
return;
case StyleShapeSourceType::URL:
MOZ_ASSERT_UNREACHABLE("shape-outside doesn't have URL source type!");
return;
case StyleShapeSourceType::Image: {
- float shapeImageThreshold = mFrame->StyleDisplay()->mShapeImageThreshold;
+ float shapeImageThreshold = styleDisplay->mShapeImageThreshold;
mShapeInfo = ShapeInfo::CreateImageShape(shapeOutside.GetShapeImage(),
shapeImageThreshold,
shapeMargin,
mFrame,
aMarginRect,
aWM,
aContainerSize);
if (!mShapeInfo) {