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 801225 832a82c64b4b1a6cafe4df03a0a43b64742736cb
parent 801224 3dab62f84c97bb5d735eb5b51c8c8e3c3fa1a037
child 801226 fad3c434c11ae617b6d520142b5427ffffad73c0
push id111608
push userbwerth@mozilla.com
push dateTue, 29 May 2018 22:29:47 +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,