Fix flex-basis incompatibilities with the browsers #427
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I went through a bunch of edge cases with flex-basis and identified where Yoga does not match the behavior of chrome and other browsers. Bellow are the gentest fixtures which I found were generating failing tests.
To test these add them to
YGFlexTest.html
and runruby rubygentest/gentest.rb
to generate the tests. The run the test suite and see these tests fail. Most failures seem to be due to us expecting width/height and flexbasis to behave identically. This is not the case. The most obvious case is a container with a set flexbasis can grow to accommodate children of larger size but a container with a set width/height cannot.just had a look at some of these tests. These are super strange.
e.g:
flex_basis_unconstraint_row
Chrome calculates
root_child0.width = 50
but the root itself isroot.width = 0
.I found the required change to make
root_child0
with a width of 50, but it fails onroot.width
(because this is 50, then too)@woehrl01 Yeah this is all pretty strange. I don't expect there to be any quick fix for this and it might require re-architecting core parts of the algorithm due to early assumptions made on how browsers handle flex-basis.
This is high impact to fix but I suggest only working on this if you have a lot of time to spend :P I have been trying to find a quicker solution from time to time but failed. Open sourced this issue for transparency more than hope that someone else will tackle it. Thanks for having a look though!