-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Implement column-count in stylo #13674
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
Conversation
Heads up! This PR modifies the following files:
|
f991495
to
b96aa25
Compare
${impl_coord_copy('column_width', 'mColumnWidth')} | ||
|
||
pub fn set_column_count(&mut self, v: longhands::column_count::computed_value::T) { | ||
use std::cmp::min; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already import std::cmp
at the top of the file. I think it looks cleaner just using cmp::min
and dropping this import.
Also, a match might be a better bet for this instead of if let
, but that's arguable:
self.gecko.mColumnCount = match v.0 {
Some(number) => cmp::min(number, nsStyleColumn_kMaxColumnCount),
None => NS_STYLE_COLUMN_COUNT_AUTO,
};
r=me with the first, and optionally with the second suggestion.
b96aa25
to
4271167
Compare
@bors-servo r=emilio |
📌 Commit 4271167 has been approved by |
Implement column-count in stylo Unblocks column-fill easy property r? @emilio <!-- 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/13674) <!-- Reviewable:end -->
☀️ Test successful - arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-dev |
Oh, hmmm, eventually we have something breaks Windows build because of use of static constant from binding. What should we do then? |
Perhaps we should manually run bindgen on all platforms, extract the link names for just these constants, and use them? |
I guess only Windows needs to be handled specially. I'm concertned about that manually running bindgen on different platforms would add too much work for people who do the merge. Probably for this case we can just make And we should probably prioritize build-time bindgen I guess? |
Actually it adds burden to patch writers as well. |
We only need to do that whenever a new static starts being used, no? I don't think the mangled name of kmaxcolumncount is going to change often, is it? But yes, making it a macro or const is a better solution. |
Probably macro works better currently. Adding an anonymous enum is not quite friendly to bindgen. |
I'll open a bug and submit a patch... later today or next week. It seems to be a blocker for me. |
(Or if anyone wants to fix that, feel free to.) |
Unblocks column-fill easy property
r? @emilio
This change is