Bug 1334227 - Early return in unimplemented shape-outside cases. r=xidorn
MozReview-Commit-ID: 8l6C9LsLpJI
--- a/layout/generic/nsFloatManager.cpp
+++ b/layout/generic/nsFloatManager.cpp
@@ -698,31 +698,34 @@ nsFloatManager::FloatInfo::FloatInfo(nsI
mShapeInfo = MakeUnique<BoxShapeInfo>(shapeBoxRect, mFrame);
} else if (shapeOutside.GetType() == StyleShapeSourceType::Shape) {
StyleBasicShape* const basicShape = shapeOutside.GetBasicShape();
switch (basicShape->GetShapeType()) {
case StyleBasicShapeType::Polygon:
// Bug 1326409 - Implement the rendering of basic shape polygon()
// for CSS shape-outside.
- break;
+ return;
case StyleBasicShapeType::Circle:
case StyleBasicShapeType::Ellipse:
mShapeInfo =
ShapeInfo::CreateCircleOrEllipse(basicShape, rect, aWM, aContainerSize);
break;
case StyleBasicShapeType::Inset:
// Bug 1326407 - Implement the rendering of basic shape inset() for
// CSS shape-outside.
- break;
+ return;
}
} else {
MOZ_ASSERT_UNREACHABLE("Unknown StyleShapeSourceType!");
}
+ MOZ_ASSERT(mShapeInfo,
+ "All shape-outside values except none should have mShapeInfo!");
+
// Translate the shape to the same origin as nsFloatManager.
mShapeInfo->Translate(aLineLeft, aBlockStart);
}
#ifdef NS_BUILD_REFCNT_LOGGING
nsFloatManager::FloatInfo::FloatInfo(FloatInfo&& aOther)
: mFrame(Move(aOther.mFrame))
, mLeftBEnd(Move(aOther.mLeftBEnd))