Repository navigation
Conversation
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @emilio (or someone else) soon. |
|
Heads up! This PR modifies the following files:
|
| fn from_computed_value(computed: &Self::ComputedValue) -> Self { | ||
| SpecifiedBorderImageRepeat(computed.0, Some(computed.1)) | ||
| } | ||
| } |
There was a problem hiding this comment.
I think you can impl ToComputedValue for BorderImageRepeat inside specified module like BorderSideWidth in specified/border.rs.
There was a problem hiding this comment.
Oh yeah, it should have been in specified/border.rs. Thanks for catching that :)
There was a problem hiding this comment.
Now that I think about it, I believe the reason BorderSideWidth can be in specified/border.rs is that its computed value is particularly simple (computed::NonNegativeLength). I don't think making specified/border.rs depend on computed/border.rs (for its ComputedValue) would be a good idea. If you think the cyclic dependency is not a problem, though, I can move it.
There was a problem hiding this comment.
I think it's okay to make it depend on computed/border.rs.
You can also check specified/font.rs.
It import font as computed
and use in the specified module.
Ex.
servo/components/style/values/specified/font.rs
Lines 1122 to 1142 in 657d8a2
There was a problem hiding this comment.
I see, that is good to know!
I don't mean to be difficult, but I wanted to understand why one way is better than the other, as they look mostly the same to me. I grepped for "impl ToComputedValue" and specified/ has 33 impls (12 of them in font.rs), while computed/ has 15 impls (including background-repeat, on which I based this). I understand you have been working on this a lot, so a completely valid reason would be something like "Consistency is good and I prefer us to standardise on this" :)
There was a problem hiding this comment.
emilio
left a comment
There was a problem hiding this comment.
This looks great, thanks @mauricioc!
| } | ||
| } | ||
|
|
||
| impl ToComputedValue for SpecifiedBorderImageRepeat { |
There was a problem hiding this comment.
I think it's fine to keep this consistent with BackgroundRepeat for now.
| /// | ||
| /// https://drafts.csswg.org/css-backgrounds/#propdef-border-image-repeat | ||
| #[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss)] | ||
| pub struct BorderImageRepeat(pub RepeatKeyword, pub RepeatKeyword); |
There was a problem hiding this comment.
We already have a RepeatKeyword in the background module, maybe rename that one as BackgroundRepeatKeyword, and this as BorderImageRepeatKeyword as a followup?
There was a problem hiding this comment.
(Background)RepeatKeyword appeared in gecko.mako.rs in two places before my changes. The first one is clearly rename-able, but the second one is in fn to_servo(repeat: StyleImageLayerRepeat) -> RepeatKeyword. Is RepeatKeyword being used here in the background sense, or is it being reused for some other purpose? Does this affect the renaming decision? Either way, I've renamed the RepeatKeyword I just added to BorderImageRepeatKeyword.
There was a problem hiding this comment.
ImageLayerRepeat is definitely related to backgrounds in Gecko terminology, so I think it's fine to rename both.
|
@bors-servo r+ |
|
📌 Commit 9695d49 has been approved by |
|
@bors-servo r+ |
|
📌 Commit 9a58fd7 has been approved by |
style: Move border-image-repeat outside of mako. Part of #19015. r? emilio --- - [X] `./mach build -d` does not report any errors - [X] `./mach build-geckolib` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #19021 - [X] These changes do not require tests <!-- 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/19668) <!-- Reviewable:end -->
|
💔 Test failed - mac-dev-unit |
|
Due to some miscommunication, there is a parallel PR for the same issue (I noticed this by coincidence while checking bors' queue). Since I believe this is a great first bug, since I forgot about this one for a long time, and since the other PR has been in the works for a while, I am giving it priority and closing this one. I will do #19671 instead :) |
|
For the record, the other PR is #19210, sorry I didn't caught that before :( |
style: Move border-image-repeat outside of mako. This is a rebased / nitpick-addressed / bug-fixed version of #19021, and with a commit from #19668 renaming the two `RepeatKeyword`s to different names. <!-- 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/19924) <!-- Reviewable:end -->
style: Move border-image-repeat outside of mako. This is a rebased / nitpick-addressed / bug-fixed version of #19021, and with a commit from #19668 renaming the two `RepeatKeyword`s to different names. <!-- 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/19924) <!-- Reviewable:end -->
style: Move border-image-repeat outside of mako. This is a rebased / nitpick-addressed / bug-fixed version of #19021, and with a commit from #19668 renaming the two `RepeatKeyword`s to different names. <!-- 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/19924) <!-- Reviewable:end -->
Part of #19015.
r? emilio
./mach build -ddoes not report any errors./mach build-geckolibdoes not report any errors./mach test-tidydoes not report any errorsThis change is