Skip to content
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

Add WeightedContentTrackSize #23

Closed
erickok opened this issue Jan 15, 2021 · 12 comments · Fixed by #19
Closed

Add WeightedContentTrackSize #23

erickok opened this issue Jan 15, 2021 · 12 comments · Fixed by #19

Comments

@erickok
Copy link

erickok commented Jan 15, 2021

It would be useful to have a WeightedContentTrackSize (or whatever we end up calling it), which would size a track based on the weight it's contents have over the total intrinsic size of all columns.

This is how an HTML table would size itself (given no other constraints). This would solve Sub6Resources/flutter_html#491.

@shyndman
Copy link
Owner

Hi @erickok,

I think that what I'm working on for #16 will help a lot here. It's basically a rework/debugging of the entire layout algorithm. I'll keep you posted.

@shyndman
Copy link
Owner

(and not like last time...work is super light for me right now, so I'm full speed ahead 😉 )

@shyndman
Copy link
Owner

I'm not quite done yet, but here's how it's looking with your user's example data:
Screen Shot 2021-01-15 at 6 09 25 PM

There's no need for a new track size, because this is how IntrinsicTrackSize is supposed to work (like an auto track in the CSS Layout Grid spec).

Video of resizing (debug build, so it's a little jumpy):
https://user-images.githubusercontent.com/42326/104787235-0a38c600-575d-11eb-892f-afc54a248225.mov

@erickok
Copy link
Author

erickok commented Jan 15, 2021

That's fantastic! Looking forward to it.

@shyndman
Copy link
Owner

shyndman commented Jan 15, 2021

Hey, so qq about what your user is encountering.

What TrackSizes are being used by your <table>s?

@erickok
Copy link
Author

erickok commented Jan 15, 2021

At the moment it's FixedTrackSizes for columns with a fixed defined width and FlexibleTrackSizes for the other rows (with either a value [0..1] if a 'fixed' percetage is defined, otherwise always value 1).

@shyndman
Copy link
Owner

Gotcha. Are you considering moving to a default of intrinsic?

@erickok
Copy link
Author

erickok commented Jan 15, 2021

Yes, absolutely, for the columns that do not define a fixed width in pixels or percentage.

@shyndman
Copy link
Owner

Percentage is an interesting one too, because FlexibleTrackSize isn't really the same thing. Flexible tracks only ever grow after everything else has been laid out.

Not sure how accurate you're trying to be with compatibility.

@erickok
Copy link
Author

erickok commented Jan 15, 2021

Not 100% sure on how html tables respond to this. In the end a 100% accuracy isn't our direct goal, but that would be nice of course. There are a lot of edge cases that you potentially have to cover to get close to a browser's behaviour, given colgroups, css,, html width, inconsistent given sizes, etc. Let's take it one step at a time. 🙂

@shyndman
Copy link
Owner

👍

@shyndman
Copy link
Owner

OK, got it. New sizing algorithm is working awesome.

I'm going to clean it up and write some tests tomorrow, then we're off to the races!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants