-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve shrink-to-fit layout (fit-content sizing) #552
Comments
Thanks for the detailed report, and the reproducible cases. This is certainly an area of the layout engine that can be improved, that I would fully support. These situations are all related to calculations of shrink-to-fit width as its called in CSS2, or more generically fit-content size in CSS3. Currently, this is done quite ad-hoc within the layout engine, and not supported for tables and flexboxes in particular. Some notes for implementing this:
Performance considerations:
Hopefully, this gives some notion of how we could get started. I'm sure this is something that needs a lot of iterations to solve more generally, we'll have to test it against a lot of different situations as it evolves. But these examples seem like good starting points. |
Absolutely positioned
div
Note that white
#wrapper
that was supposed to wrap all nested blocks, in fact has width = 2 (empty content + 2 pixels for borders):If I remove "position: absolute", it does the right thing:
Blocks with
display: flex
Note that outer (red) block doesn't "see" that its inner (blue) block has any width:
Complex grid layouts
This is how RmlUi renders it:
Equivalent layout in HTML/CSS (expected result):
Interesting is that if I swap
flex-direction
in outer and inner blocks (outer tocolumn
, inner torow
), then RmlUi doesn't render anything:While HTML/CSS renders it as expected:
I believe that the root cause is the same as in #520, and while 8a94ab7 fixed it for a trivial case, a larger body of cases is still not supported.
The text was updated successfully, but these errors were encountered: