aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-04-23 02:51:47 -0500
committerGitHub <noreply@github.com>2017-04-23 02:51:47 -0500
commit33c6abb1a8a908e848e5aab77bd9c2a94647b74c (patch)
treecb50b6cc07cb70e2490c08fd4acd6bd63ae17a7e /components
parent541db5f9a791f52e22d409d3b40b13223df69b4c (diff)
parent43525819f4f40d0852f49724592ebc75dd5cf849 (diff)
downloadservo-33c6abb1a8a908e848e5aab77bd9c2a94647b74c.tar.gz
servo-33c6abb1a8a908e848e5aab77bd9c2a94647b74c.zip
Auto merge of #16522 - chenpighead:stylo-border-reset-border-image, r=heycam
Reset longhands of border-image to their initial value while parsing border shorthand To do so, we need to declare the border-image longhands as part of border shorthand and always reset them. Spec link: https://drafts.csswg.org/css-backgrounds-3/#the-border-shorthands <!-- Please describe your changes on the following line: --> --- <!-- 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 #15202 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- 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/16522) <!-- Reviewable:end -->
Diffstat (limited to 'components')
-rw-r--r--components/style/properties/shorthand/border.mako.rs21
1 files changed, 16 insertions, 5 deletions
diff --git a/components/style/properties/shorthand/border.mako.rs b/components/style/properties/shorthand/border.mako.rs
index 8441f5ce395..1ee9d3ff8da 100644
--- a/components/style/properties/shorthand/border.mako.rs
+++ b/components/style/properties/shorthand/border.mako.rs
@@ -122,13 +122,18 @@ pub fn parse_border(context: &ParserContext, input: &mut Parser)
</%helpers:shorthand>
% endfor
-<%helpers:shorthand name="border" sub_properties="${' '.join(
- 'border-%s-%s' % (side, prop)
- for side in ['top', 'right', 'bottom', 'left']
- for prop in ['color', 'style', 'width']
-)}" spec="https://drafts.csswg.org/css-backgrounds/#border">
+<%helpers:shorthand name="border"
+ sub_properties="${' '.join('border-%s-%s' % (side, prop)
+ for side in ['top', 'right', 'bottom', 'left']
+ for prop in ['color', 'style', 'width'])}
+ ${' '.join('border-image-%s' % name
+ for name in ['outset', 'repeat', 'slice', 'source', 'width'])}"
+ spec="https://drafts.csswg.org/css-backgrounds/#border">
pub fn parse_value(context: &ParserContext, input: &mut Parser) -> Result<Longhands, ()> {
+ use properties::longhands::{border_image_outset, border_image_repeat, border_image_slice};
+ use properties::longhands::{border_image_source, border_image_width};
+
let (color, style, width) = try!(super::parse_border(context, input));
Ok(Longhands {
% for side in ["top", "right", "bottom", "left"]:
@@ -136,6 +141,12 @@ pub fn parse_border(context: &ParserContext, input: &mut Parser)
border_${side}_style: style,
border_${side}_width: width.clone(),
% endfor
+
+ // The ‘border’ shorthand resets ‘border-image’ to its initial value.
+ // See https://drafts.csswg.org/css-backgrounds-3/#the-border-shorthands
+ % for name in "outset repeat slice source width".split():
+ border_image_${name}: border_image_${name}::get_initial_specified_value(),
+ % endfor
})
}