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. #19210
Conversation
|
This has a couple of build errors, but it's a good start! Let me know if I can help fixing them somehow. |
| where | ||
| W: fmt::Write, | ||
| { | ||
| match (self.0, self.1) { |
This comment has been minimized.
This comment has been minimized.
emilio
Nov 14, 2017
Member
There's no need for match here, just:
let BorderImageRepeat(horizontal, vertical) = *self;
This comment has been minimized.
This comment has been minimized.
|
|
||
| #[inline] | ||
| fn from_computed_value(computed: &Self::ComputedValue) -> Self { | ||
| match (computed) { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
emilio
Nov 18, 2017
Member
This is probably still not building, let me know if you need any help setting up the build environment or if I can help somehow, I'd be glad to :)
highfive
commented
Nov 14, 2017
|
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. |
highfive
commented
Nov 14, 2017
|
Heads up! This PR modifies the following files:
|
highfive
commented
Nov 14, 2017
|
@emilio Thanks for the review!!I'll fix it:) |
| @@ -1680,8 +1681,8 @@ impl FragmentDisplayListBuilding for Fragment { | |||
| corners.3.resolve(webrender_image.width)), | |||
| // TODO(gw): Support border-image-outset | |||
| outset: SideOffsets2D::zero(), | |||
| repeat_horizontal: convert_repeat_mode(border_style_struct.border_image_repeat.0), | |||
| repeat_vertical: convert_repeat_mode(border_style_struct.border_image_repeat.1), | |||
| repeat_horizontal: convert_repeat_mode(border_style_struct.BorderImageRepeatKeyword.0), | |||
This comment has been minimized.
This comment has been minimized.
| where | ||
| W: fmt::Write, | ||
| { | ||
| let BorderImageRepeat(horizontal, vertical) = *self; |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
||
| #[inline] | ||
| fn from_computed_value(computed: &Self::ComputedValue) -> Self { | ||
| match (computed) { |
This comment has been minimized.
This comment has been minimized.
emilio
Nov 18, 2017
Member
This is probably still not building, let me know if you need any help setting up the build environment or if I can help somehow, I'd be glad to :)
|
@emilio Sorry for interval.I fixed little bit but stuck...I can't solve the build error below.
|
|
Sorry for the huge lag here @chansuke! For the unresolved import, you need to export that value from For Other than that it looks great! |
|
|
|
@emilio Thank you for your help!!I fixed the error.The remaining error is
|
|
@chansuke You only need to write For example, here are documentation comments for servo/components/style/values/specified/border.rs Lines 21 to 32 in f7440bf |
|
@CYBAI Thanks! |
c397ba9
to
64a425f
|
|
|
|
Sorry for the lag.I will rebase and fix the error. |
64a425f
to
ef597cd
|
Looks fine, but there are still Geckolib build errors (you can check them with |
|
|
|
@emilio Hi.I'm blocking with these build errors below.I was wondering if you could give me some suggestions.Thanks.
|
ef597cd
to
ccef94c
|
With your patch, About other error messages which is |
dc8cc2a
to
bbd0807
|
@emilio I fixed build errors.I wonder if you could check this. |
|
Looks good! Some stuff still could be cleaner, but let me know if you just want to land this and we can tidy this up in followups :) |
| #[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss)] | ||
| pub enum BorderImageRepeat { | ||
| /// `[ stretch | repeat | round | space ]{1,2}` | ||
| Keywords(RepeatKeyword, Option<RepeatKeyword>), |
This comment has been minimized.
This comment has been minimized.
emilio
Jan 21, 2018
Member
This is just an enum with a single variant, so this can be a struct BorderImageRepeat(RepeatKeyword, Option<RepeatKeyword>), right?
| /// An angle rounded and normalized per https://drafts.csswg.org/css-images/#propdef-image-orientation | ||
| #[allow(missing_docs)] | ||
| #[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq)] | ||
| pub enum Orientation { |
This comment has been minimized.
This comment has been minimized.
| fn from_computed_value(computed: &Self::ComputedValue) -> Self { | ||
| match (computed.0, computed.1) { | ||
| (horizontal, vertical) => { | ||
| SpecifiedBorderImageRepeat::Keywords(horizontal, Some(vertical)) |
This comment has been minimized.
This comment has been minimized.
emilio
Jan 21, 2018
Member
This can just be:
SpecifiedBorderImageRepeat::Keywords(computed.0, Some(computed.1))Instead of this match expression.
| where | ||
| W: fmt::Write, | ||
| { | ||
| match (self.0, self.1) { |
This comment has been minimized.
This comment has been minimized.
| SpecifiedBorderImageRepeat::Keywords(horizontal, vertical) => { | ||
| BorderImageRepeat(horizontal, vertical.unwrap_or(horizontal)) | ||
| } | ||
| } |
This comment has been minimized.
This comment has been minimized.
CYBAI
Jan 21, 2018
•
Collaborator
I'm wondering, when we only have only one pattern, will it be better to use if let here?
| }; | ||
|
|
||
| let vertical = input.try(RepeatKeyword::parse).ok(); | ||
| Ok(BorderImageRepeat::Keywords(horizontal, vertical)) |
This comment has been minimized.
This comment has been minimized.
CYBAI
Jan 21, 2018
Collaborator
IMO, the original parse method looks easier to understand for me.
Just curious if you met any difficulty when you tried to use the original method?
let first = RepeatKeyword::parse(input)?;
let second = input.try(RepeatKeyword::parse).ok();
Ok(SpecifiedValue(first, second))bbd0807
to
f3347ef
f3347ef
to
0149703
|
|
chansuke commentedNov 14, 2017
•
edited
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is