Bug 1460041 Part 1: Correct PolygonShapeInfo constructor to measure its start and end block extents in margin rect space. draft
authorBrad Werth <bwerth@mozilla.com>
Tue, 08 May 2018 15:56:49 -0700
changeset 793846 8af5d988e99ad98ced9067c335b940c59f31739c
parent 793594 b52b2eb81d1e52d259d55d948281c7f6ddf1270c
child 793847 d5280fbd2d1b615b0e64d85e7cfd65536544103f
child 793906 698d686619f64e3a243403efdaddfd16079928cb
child 793910 e1ba49aa7ff7f4034ac520f0fe86745a81b9140b
push id109515
push userbwerth@mozilla.com
push dateThu, 10 May 2018 21:27:02 +0000
bugs1460041
milestone62.0a1
Bug 1460041 Part 1: Correct PolygonShapeInfo constructor to measure its start and end block extents in margin rect space. MozReview-Commit-ID: 5pxiK1oH7sn
layout/generic/nsFloatManager.cpp
--- a/layout/generic/nsFloatManager.cpp
+++ b/layout/generic/nsFloatManager.cpp
@@ -1380,27 +1380,27 @@ nsFloatManager::PolygonShapeInfo::Polygo
     // Find the left and right i intercepts of the polygon edge for this
     // block row, and adjust them to compensate for the expansion of the
     // inline dimension. If we're in the expanded region, or if we're using
     // a b that's less than the bStart of the polygon, the intercepts are
     // the nscoord min and max limits.
     nscoord bInAppUnits = (b - kbExpansionPerSide) * aAppUnitsPerDevPixel;
     bool bIsInExpandedRegion(b < kbExpansionPerSide ||
                              b >= bSize - kbExpansionPerSide);
-    bool bIsLessThanPolygonBStart(bInAppUnits < mBStart);
-    bool bIsMoreThanPolygonBEnd(bInAppUnits >= mBEnd);
 
     // We now figure out the i values that correspond to the left edge and
     // the right edge of the polygon at one-dev-pixel-thick strip of b. We
     // have a ComputeLineIntercept function that takes and returns app unit
     // coordinates in the space of aMarginRect. So to pass in b values, we
     // first have to add the aMarginRect.y value. And for the values that we
     // get out, we have to subtract away the aMarginRect.x value before
     // converting the app units to dev pixels.
     nscoord bInAppUnitsMarginRect = bInAppUnits + aMarginRect.y;
+    bool bIsLessThanPolygonBStart(bInAppUnitsMarginRect < mBStart);
+    bool bIsMoreThanPolygonBEnd(bInAppUnitsMarginRect >= mBEnd);
 
     const int32_t iLeftEdge = (bIsInExpandedRegion ||
                                bIsLessThanPolygonBStart ||
                                bIsMoreThanPolygonBEnd) ? nscoord_MAX :
       kiExpansionPerSide + NSAppUnitsToIntPixels(
         ComputeLineIntercept(bInAppUnitsMarginRect,
                              bInAppUnitsMarginRect + aAppUnitsPerDevPixel,
                              std::min<nscoord>, nscoord_MAX) - aMarginRect.x,