Bug 1461046 Part 3: Change RoundedBoxShapeInfo to tolerate empty rects. draft
authorBrad Werth <bwerth@mozilla.com>
Fri, 18 May 2018 17:38:41 -0700
changeset 803571 5ceda79450157fe427438336a24c117d56003831
parent 803570 6d3893660c55b2c93f1f00454a4d49ed69ce4837
child 803572 acdc0b634f54fb65dd55a3b5a811eb0244332db3
push id112151
push userbwerth@mozilla.com
push dateMon, 04 Jun 2018 15:53:26 +0000
bugs1461046
milestone62.0a1
Bug 1461046 Part 3: Change RoundedBoxShapeInfo to tolerate empty rects. MozReview-Commit-ID: FNQwXdeqfua
layout/generic/nsFloatManager.cpp
--- a/layout/generic/nsFloatManager.cpp
+++ b/layout/generic/nsFloatManager.cpp
@@ -1079,17 +1079,23 @@ public:
                       int32_t aAppUnitsPerDevPixel);
 
   nscoord LineLeft(const nscoord aBStart,
                    const nscoord aBEnd) const override;
   nscoord LineRight(const nscoord aBStart,
                     const nscoord aBEnd) const override;
   nscoord BStart() const override { return mRect.y; }
   nscoord BEnd() const override { return mRect.YMost(); }
-  bool IsEmpty() const override { return mRect.IsEmpty(); }
+  bool IsEmpty() const override {
+    // A RoundedBoxShapeInfo is never empty, because if it is collapsed to
+    // zero area, it acts like a point. If it is collapsed further, to become
+    // inside-out, it acts like a rect in the same shape as the inside-out
+    // rect.
+    return false;
+  }
 
   void Translate(nscoord aLineLeft, nscoord aBlockStart) override
   {
     mRect.MoveBy(aLineLeft, aBlockStart);
 
     if (mShapeMargin > 0) {
       MOZ_ASSERT(mLogicalTopLeftCorner && mLogicalTopRightCorner &&
                  mLogicalBottomLeftCorner && mLogicalBottomRightCorner,