Repository navigation
Extend whitespace::T with additional helper methods - #8542
Conversation
|
r? @SimonSapin |
2f4c2f4 to
8e9a0d9
Compare
There was a problem hiding this comment.
Since the type is defined in the same crate, I don’t think a trait is necessary here. Have you tried making this an inherent impl white_space::T {}?
Less important: I’m not sure about this file’s name or having a separate file in the first place. Do you expect to have more code related to inline layout go here in future?
There was a problem hiding this comment.
If I read your comment in #8128 right, you said that these methods should live in an extension trait in a file called inline.rs. Do you mean that I should disregard that comment and implement these methods in properties.mako.rs instead?
There was a problem hiding this comment.
Ah, sorry for the misunderstanding, my earlier message wasn’t clear and didn’t have it in mind anymore when I replied here.
Since Ms2ger mentioned replacing something from components/layout/fragment.rs, I was assuming that it would stay in the layout crate. If you want to define in the layout crates methods for a type defined in the style crate, then you’d need a trait. And if it’s related to inline layout, it would make sense to have it in components/layout/inline.rs.
But looking now at what these methods actually do, it’s not a complex layout algorithm that particularly belongs in the layout crate. I think having it in the style crate is fine.
So, yeah, please make it an inherent impl without a trait, next to the definition of the white space property in properties.mako.rs. Thanks!
8e9a0d9 to
724ce0e
Compare
|
I think the idea was for this new module/trait to live in the layout crate, not the style crate. (I don't feel strongly either way.) |
724ce0e to
7de7cb4
Compare
|
Now it lives under r? @SimonSapin |
|
@bors-servo r+ Reviewed 7 of 7 files at r2. Comments from the review on Reviewable.io |
|
📌 Commit 7de7cb4 has been approved by |
Extend whitespace::T with additional helper methods Fixes #8128. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8542) <!-- Reviewable:end -->
|
💔 Test failed - linux-rel |
Extend whitespace::T with additional helper methods Fixes #8128. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8542) <!-- Reviewable:end -->
|
☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt |
Fixes #8128.