mozilla / lightbeam

Orignal unmaintained version of the Lightbeam extension. See lightbeam-we for the new one which works in modern versions of Firefox.
https://github.com/mozilla/lightbeam-we
Mozilla Public License 2.0
586 stars 149 forks source link

Add "min-height:0" to flex items, to disable flexbox min-content sizing ... #640

Closed dholbert closed 9 years ago

dholbert commented 9 years ago

This should fix issue #637. (I haven't actually built & tested lightbeam, but I made these exact edits to the release LightBeam add-on via Firefox's DevTools and I confirmed that the list became scrollable again (and reasonably-sized) and the controls reappeared at the bottom again.

dholbert commented 9 years ago

Brief explanation of the patch:

So, this issue is an instance of https://bugzilla.mozilla.org/show_bug.cgi?id=1043520 -- that's a metabug I filed to tracks bustage from the introduction of "min-height:auto" / "min-width:auto" behavior on flex items.

Basically, as of https://bugzilla.mozilla.org/show_bug.cgi?id=984711, flex items (children of "display:flex" elements) will now refuse to be smaller than their auto-height (if the flex container is vertical -- similarly, they'll refuse to shrink below their min-content width, if their container is horizontal). This is specced here: http://dev.w3.org/csswg/css-flexbox/#min-size-auto

This generally makes behavior more intuitive & prevents overflow caused by flexing in most circumstances, so it's a good change, BUT there are also cases like this LightBeam issue where the auto height is actually really huge (the height of the full list), and the web developer does actually want the flex item to take on a height that's smaller than that auto-height, because they know that one of the descendants will correctly handle its overflow (via overflow-y:scroll in this case). In this sort of case, the web developer now has to specify "min-height:0" to disable the automatic min-sizing behavior.

In this case, there are several layers of vertical flex containers, so we have to make this change at two levels for it to actually work (since we have to disable this behavior on the flex item at both nesting levels).

fmarier commented 9 years ago

Thanks so much @dholbert, I can confirm that this fixes #637 on Firefox 34 (while not affecting 31).