Repository navigation
style: move list-style-image out of mako - #19570
Conversation
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @pcwalton (or someone else) soon. |
|
Heads up! This PR modifies the following files:
|
| } | ||
|
|
||
| #[cfg(not(feature = "gecko"))] | ||
| let value = input.try(|input| UrlOrNone::parse(context, input))?; |
There was a problem hiding this comment.
I could possibly use #[allow(unused_mut)] to avoid this #[cfg(not(feature = "gecko"))].
I'm not sure what would be the most correct way.
emilio
left a comment
There was a problem hiding this comment.
Looks great! Just minor nits, thanks a lot!
|
|
||
| impl ListStyleImage { | ||
| /// Initial value for `list-style-image`. | ||
| /// |
There was a problem hiding this comment.
nit: let's remove this extra line.
| /// Initial value for `list-style-image`. | ||
| /// | ||
| #[inline] | ||
| pub fn get_initial_value() -> ListStyleImage { |
| use values::specified::UrlOrNone; | ||
|
|
||
| /// Specified and computed `list-style-image` property. | ||
| /// |
There was a problem hiding this comment.
Let's remove this extra newline.
|
|
||
| impl ListStyleImage { | ||
| /// Initial specified value for `list-style-image`. | ||
| /// |
| let mut value = input.try(|input| UrlOrNone::parse(context, input))?; | ||
| if let Either::First(ref mut url) = value { | ||
| url.build_image_value(); | ||
| } |
There was a problem hiding this comment.
let's return Ok(ListStyleImage(value)) here so it's clearer that the code below doesn't really run, I think, or #[allow(unused_mut)]
| /// Initial specified value for `list-style-image`. | ||
| /// | ||
| #[inline] | ||
| pub fn get_initial_specified_value() -> ListStyleImage { |
There was a problem hiding this comment.
Let's just define none here, and remove the impl block in the computed module, actually.
There was a problem hiding this comment.
Hey, thanks for reviewing. I'm not sure I understand the none definitions. Can you explain it further? (I'm beginning at Rust)
There was a problem hiding this comment.
Sure! I'm just saying that calling this method none (which is the value it returns) is slightly more idiomatic.
That way, you call it like ListStyleImage::none(), instead of get_initial_value, which is not very useful as a name to know what value is it.
| initial_value="computed::ListStyleImage::get_initial_value()", | ||
| initial_specified_value="specified::ListStyleImage::get_initial_specified_value()", | ||
| animation_value_type="discrete", | ||
| boxed="True" if product == "gecko" else "False", |
There was a problem hiding this comment.
I think this can be boxed=product == "gecko" now.
|
@emilio made a few changes regarding your comments |
emilio
left a comment
There was a problem hiding this comment.
Looks great! Mind squashing your commits?
| ${helpers.predefined_type("list-style-image", | ||
| "ListStyleImage", | ||
| initial_value="specified::ListStyleImage::none()", | ||
| initial_specified_value="specified::ListStyleImage::none()", |
There was a problem hiding this comment.
Should I work to remove this apparently duplication?
I see that the initial_specified_value is kind of necessary, or the code fails trying to unwrap_or_initial!, which tries to call get_specified_initial_value().
There was a problem hiding this comment.
Yeah, we may be able to clean that up a bit. I fail to remember the details, but happy to page those back in if you want! Mind opening an issue? I'll happily comment on it when I do and assign it to you if you want :)
cleaner way to set boxed param redefine get_initial_value to none make parse method clearer remove some extra lines
d0b72fd to
eb88a29
Compare
|
Commits squashed. 👍 |
|
@bors-servo r+ |
|
📌 Commit eb88a29 has been approved by |
|
Thanks a lot! |
style: move list-style-image out of mako <!-- Please describe your changes on the following line: --> Moving `list-style-image` out of mako. --- <!-- 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 - [X] These changes fix #19557 (part of #19015 ). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because refactoring <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- 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/19570) <!-- Reviewable:end -->
|
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev |
Moving
list-style-imageout of mako../mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is