Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd keyword "auto" to flexbox min-size property #14332
Conversation
|
Generally this looks good to me, but need some changes. |
| LengthOrPercentageOrAuto::Auto => Au(0), | ||
| } | ||
| } | ||
|
|
This comment has been minimized.
This comment has been minimized.
stshine
Nov 23, 2016
Contributor
This function is unnessasary, and its name is quite confusing, hinting that it will return a MaybeAuto type. Use MaybeAuto::from_style().specified_or_zero() should be enough.
| computed::LengthOrPercentageOrAuto::Length(Au(0)) | ||
| ); | ||
| } | ||
| % endfor |
This comment has been minimized.
This comment has been minimized.
stshine
Nov 23, 2016
Contributor
I can not understand why we need this. I assume that you are going to change specified_or_auto() later? But use MaybeAuto::from_style().specified_or_zero() should provide us enough flexibility.
This comment has been minimized.
This comment has been minimized.
stshine
Nov 23, 2016
Contributor
Just found that for non-flex items the computed value of min-width should be 0px if not specified, never mind.
This comment has been minimized.
This comment has been minimized.
shinglyu
Nov 25, 2016
Author
Member
Yes, I also added a wpt test for that. But I'm not sure if I put it in the correct location.
This comment has been minimized.
This comment has been minimized.
stshine
Nov 25, 2016
Contributor
:) It is ok to put css tests there because they can not be easily upstreamed.
|
cc @SimonSapin for the style part changes. |
|
Reviewed 8 of 8 files at r1, 1 of 1 files at r2, 2 of 2 files at r3. components/layout/model.rs, line 460 at r3 (raw file): Previously, stshine wrote…
I agree that the name should indicate that 'auto' is treated as zero. components/style/properties/properties.mako.rs, line 1706 at r2 (raw file): https://drafts.csswg.org/css-flexbox/#valdef-min-width-auto
Comments from Reviewable |
|
|
|
Based on the new comment, it's non-trivial to determine if an element is a flex item, so I need some other way around this:
|
|
IMO we currently do not support |
|
But Firefox does support In terms of threading / parallel tree traversal, the styling of ancestors is finished by the time we style an element. It should be possible to make this available to the cascading code. |
|
Yeah, this will need to look up (or have some kind of hint from the parent). It's not problematic for now though, and you can ignore that until we implement display contents for stylo. |
|
What's the next step here? Who's responsible for it? |
|
I’ve requested code changes from @shinglyu, the most significant one being checking not just for flex items but also "whose overflow is visible [etc.]" #14332 (comment) |
|
Sorry, I'll get back to this after the holidays
Simon Sapin <notifications@github.com> 於 2017年1月28日 週六 17:16 寫道:
… I’ve requested code changes from @shinglyu <https://github.com/shinglyu>,
the most significant one being checking not just for flex items but also
"whose overflow is visible [etc.]" #14332 (comment)
<#14332 (comment)>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#14332 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADGbJ3njlDwIoVkFXJNxY7W_IOvy43ZRks5rWwdZgaJpZM4K6Ljj>
.
|
|
@shinglyu Status? |
|
I'm fully occupied by Stylo right now. Maybe need to postpone this for a while. If anyone is interested to take over please go ahead. |
|
@shinglyu I would like to finish this if you do not have time. |
|
That'd be awesome @stshine! :) |
|
@emilio I'll take a look at the stylo implemention first :) |
style: Support "auto" keyword on min-{width, height} properties
<!-- Please describe your changes on the following line: -->
Based on the work of #14332 .
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).
<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15969)
<!-- Reviewable:end -->
style: Support "auto" keyword on min-{width, height} properties
<!-- Please describe your changes on the following line: -->
Based on the work of #14332 .
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).
<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15969)
<!-- Reviewable:end -->
style: Support "auto" keyword on min-{width, height} properties
<!-- Please describe your changes on the following line: -->
Based on the work of #14332 .
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).
<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15969)
<!-- Reviewable:end -->
style: Support "auto" keyword on min-{width, height} properties
<!-- Please describe your changes on the following line: -->
Based on the work of #14332 .
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).
<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15969)
<!-- Reviewable:end -->
style: Support "auto" keyword on min-{width, height} properties
<!-- Please describe your changes on the following line: -->
Based on the work of #14332 .
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).
<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15969)
<!-- Reviewable:end -->
style: Support "auto" keyword on min-{width, height} properties
<!-- Please describe your changes on the following line: -->
Based on the work of #14332 .
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).
<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15969)
<!-- Reviewable:end -->
style: Support "auto" keyword on min-{width, height} properties
<!-- Please describe your changes on the following line: -->
Based on the work of #14332 .
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).
<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15969)
<!-- Reviewable:end -->
style: Support "auto" keyword on min-{width, height} properties
<!-- Please describe your changes on the following line: -->
Based on the work of #14332 .
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).
<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15969)
<!-- Reviewable:end -->
|
Let's close this due to inactivity, and given it needs a huge rebase. |
shinglyu commentedNov 23, 2016
•
edited by larsbergstrom
This is the first patch for #12610, the algorithm itself took longer than I expected, so I'm landing this foundational work first.
This adds a new initial value
autoto themin-widthandmin-heightspecified on a flexitem. It also provides a fallback of "0px" if we try to get themin-width/heighton a non-flexitem box usinggetComputedStyle.The
autoresolution algorithm is not ready yet, so we fall back to0pxduring layout.r?@stshine
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is