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 upstyle: Move border-image-repeat outside of mako. #19668
Conversation
highfive
commented
Jan 1, 2018
|
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. |
highfive
commented
Jan 1, 2018
|
Heads up! This PR modifies the following files:
|
highfive
commented
Jan 1, 2018
| fn from_computed_value(computed: &Self::ComputedValue) -> Self { | ||
| SpecifiedBorderImageRepeat(computed.0, Some(computed.1)) | ||
| } | ||
| } |
This comment has been minimized.
This comment has been minimized.
CYBAI
Jan 1, 2018
Collaborator
I think you can impl ToComputedValue for BorderImageRepeat inside specified module like BorderSideWidth in specified/border.rs.
This comment has been minimized.
This comment has been minimized.
collares
Jan 1, 2018
Author
Contributor
Oh yeah, it should have been in specified/border.rs. Thanks for catching that :)
This comment has been minimized.
This comment has been minimized.
collares
Jan 1, 2018
•
Author
Contributor
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.
This comment has been minimized.
This comment has been minimized.
CYBAI
Jan 1, 2018
Collaborator
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
This comment has been minimized.
This comment has been minimized.
collares
Jan 1, 2018
Author
Contributor
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" :)
This comment has been minimized.
This comment has been minimized.
|
This looks great, thanks @mauricioc! |
| } | ||
| } | ||
|
|
||
| impl ToComputedValue for SpecifiedBorderImageRepeat { |
This comment has been minimized.
This comment has been minimized.
| /// | ||
| /// https://drafts.csswg.org/css-backgrounds/#propdef-border-image-repeat | ||
| #[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss)] | ||
| pub struct BorderImageRepeat(pub RepeatKeyword, pub RepeatKeyword); |
This comment has been minimized.
This comment has been minimized.
emilio
Jan 1, 2018
Member
We already have a RepeatKeyword in the background module, maybe rename that one as BackgroundRepeatKeyword, and this as BorderImageRepeatKeyword as a followup?
This comment has been minimized.
This comment has been minimized.
collares
Jan 1, 2018
Author
Contributor
(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.
This comment has been minimized.
This comment has been minimized.
emilio
Jan 1, 2018
Member
ImageLayerRepeat is definitely related to backgrounds in Gecko terminology, so I think it's fine to rename both.
|
@bors-servo r+ |
|
|
|
@bors-servo r+ |
|
|
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 -->
|
|
|
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 -->
collares commentedJan 1, 2018
•
edited by emilio
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