-
Notifications
You must be signed in to change notification settings - Fork 108
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
Support the overflow
property
#304
Comments
I came across a usecase where I would need this, which made me wondering about what this PR would imply on the test side as nodes specifying "scroll" or "hidden" overflows might have a content size that might differ from the actual shown size. Which may lead to larger assertions. (I might aswell be overthinking this but I tough the thinking was interesting) https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollWidth Here would be a sample test (not very generic as it implies gap & flex, but it demonstrates my point) <div id="test-root" style="display: flex; flex-direction: column; width: 100px; height: 100px; gap: 50px; overflow: scroll;">
<div style="width: 50px; height: 50px;"></div>
<div style="width: 50px; height: 50px;"></div>
<div style="width: 50px; height: 50px;"></div>
<div style="width: 50px; height: 50px;"></div>
<div style="width: 50px; height: 50px;"></div>
<div style="width: 50px; height: 50px;"></div>
</div> |
After looking into this some more I have the following conclusions:
There is also this in Yoga "The W3C spec doesn't say anything about the 'overflow' property, but all major browsers appear to implement the following logic". But I haven't determined exactly what the effect of this code is yet. It doesn't look like it would make a huge difference, but it might be nice to support anyway. |
There is an additional effect of |
Splitting |
What problem does this solve or what need does it fill?
Layout of UI containing scrollable regions.
What solution would you like?
Taffy should not implement support for scrolling itself (the actual scroll offset). But it should implement support for layout for nodes that are scrollable:
Overflow
, which can be controlled independently in each axis.Overflow::Hidden
#424overflow: hidden
(orscroll
orauto
) in a given axis then it's automatic minimum size can be assumed to be zero (this is partly a performance optimisation, but it can also affect layout).Overflow::Scroll
#446overflow: scroll
in a given axis andscrollbar-width
is greater than0
, then space for a scrollbar should be set aside in the opposite axis (vertical scrolling requires a scrollbar that takes up horizontal space). This space should also be added to it's content size for the purpose of intrinsic sizing.The text was updated successfully, but these errors were encountered: