Bug 1501768 - Maximum sizing section should also consider if a max-clamped flex item shrank. r=pbro
authorMicah Tigley <mtigley@mozilla.com>
Thu, 15 Nov 2018 08:35:31 +0000
changeset 503128 01d04147fd943da72fdd02a52fb1361317cf7fb7
parent 503127 bfa775531d0d04e8707eb3630c7370b192d82887
child 503129 11b611171e239700d47156fb98e337915456308e
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbro
bugs1501768
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1501768 - Maximum sizing section should also consider if a max-clamped flex item shrank. r=pbro Differential Revision: https://phabricator.services.mozilla.com/D11922
devtools/client/inspector/flexbox/components/FlexItemSizingProperties.js
--- a/devtools/client/inspector/flexbox/components/FlexItemSizingProperties.js
+++ b/devtools/client/inspector/flexbox/components/FlexItemSizingProperties.js
@@ -216,25 +216,27 @@ class FlexItemSizingProperties extends P
         this.renderReasons(reasons)
       )
     );
   }
 
   renderMaximumSizeSection(flexItemSizing, properties, dimension) {
     const { clampState, mainMaxSize, mainDeltaSize } = flexItemSizing;
     const grew = mainDeltaSize > 0;
+    const shrank = mainDeltaSize < 0;
     const maxDimensionValue = properties[`max-${dimension}`];
 
     if (clampState !== "clamped_to_max") {
       return null;
     }
 
     const reasons = [];
-    if (grew) {
+    if (grew || shrank) {
       // The item may have wanted to grow more than it did, because it was max-clamped.
+      // Or the item may have wanted shrink more, but it was clamped to its max size.
       reasons.push(getStr("flexbox.itemSizing.clampedToMax"));
     }
 
     return (
       dom.li({ className: "section max" },
         dom.span({ className: "name" },
           getStr("flexbox.itemSizing.maxSizeSectionHeader"),
           maxDimensionValue.length ?