Bug 1334227 - Early return in unimplemented shape-outside cases. r=xidorn
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 02 Feb 2017 11:53:06 +0800
changeset 469859 abc3cb8fff3ee3acfa6c62d56b40e50cb8c3489c
parent 469616 dd7cce059626e9787537bf9ba7863a6ad8ac06a1
child 469860 0592bfbbc9a41136079edbd1f079e6fa016eaa26
push id43881
push userbmo:gps@mozilla.com
push dateThu, 02 Feb 2017 23:49:03 +0000
reviewersxidorn
bugs1334227
milestone54.0a1
Bug 1334227 - Early return in unimplemented shape-outside cases. r=xidorn MozReview-Commit-ID: 8l6C9LsLpJI
layout/generic/nsFloatManager.cpp
--- 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))