I think is out of the scope of this patch. Adding this was aprt of your suggestions https://github.com/mozilla-b2g/gaia/pull/16572#discussion_r11434261, and I consider that changing the entire logic should be in a separate patch. This one should be related *only* with the flex layout, and the minimum JS changes in order to make it works.