New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement border-image shorthand #14189
Conversation
338a8ab
to
bf64f83
Compare
@@ -196,6 +201,14 @@ ${helpers.single_keyword("-moz-float-edge", "content-box margin-box", | |||
computed::LengthOrNumber::Number(0.0)) | |||
} | |||
|
|||
#[inline] | |||
pub fn get_initial_specified_value() -> SpecifiedValue { | |||
SpecifiedValue(vec![LengthOrNumber::Number(Number(0.0)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to represent this as a single number.
@@ -449,6 +467,14 @@ ${helpers.single_keyword("-moz-float-edge", "content-box margin-box", | |||
computed_value::SingleComputedValue::Number(1.0)) | |||
} | |||
|
|||
#[inline] | |||
pub fn get_initial_specified_value() -> SpecifiedValue { | |||
SpecifiedValue(vec![SingleSpecifiedValue::Number(Number(1.0)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
@@ -301,6 +314,11 @@ ${helpers.single_keyword("-moz-float-edge", "content-box margin-box", | |||
computed_value::T(RepeatKeyword::Stretch, RepeatKeyword::Stretch) | |||
} | |||
|
|||
#[inline] | |||
pub fn get_initial_specified_value() -> SpecifiedValue { | |||
SpecifiedValue(RepeatKeyword::Stretch, Some(RepeatKeyword::Stretch)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None for the second
pub fn get_initial_specified_value() -> SpecifiedValue { | ||
SpecifiedValue { | ||
corners: vec![PercentageOrNumber::Percentage(Percentage(1.0)), | ||
PercentageOrNumber::Percentage(Percentage(1.0)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
slice = Some(value); | ||
|
||
// Parse border image width and outset, if applicable. | ||
try!(input.try(|input| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
// Parse border image width and outset, if applicable.
let maybe width_outset = input.try(|input| {
try!(input.expect_delim('/'));
// Parse border image width, if applicable.
let w = input.try(|input|
border_image_width::parse(context, input)).ok();
// Parse border image outset if applicable.
let o = input.try(|input| {
try!(input.expect_delim('/'));
border_image_outset::parse(context, input)
}).ok();
Ok((w, o))
});
if let Ok(w, o) = maybe_width_outset {
width = w;
outset = o;
}
In case the try fails you do not want width
and outset
to be written to.
bf64f83
to
b1b4f7c
Compare
b1b4f7c
to
e408b0e
Compare
r? @Manishearth Could you review when you're available? :) |
@bors-servo r+ looks good! |
📌 Commit e408b0e has been approved by |
Implement border-image shorthand <!-- Please describe your changes on the following line: --> Implementation of border-image shorthand. r? Manishearth --- <!-- 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 <!-- Either: --> - [X] There are tests for these changes <!-- 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/14189) <!-- Reviewable:end -->
☀️ Test successful - arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-dev |
Implementation of border-image shorthand.
r? Manishearth
./mach build -d
does not report any errors./mach test-tidy
does not report any errorsThis change is