Skip to content
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

Merged
merged 2 commits into from Nov 14, 2016

Conversation

@canova
Copy link
Member

commented Nov 12, 2016

Implementation of border-image shorthand.
r? Manishearth


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • There are tests for these changes

This change is Reviewable

@highfive

This comment has been minimized.

Copy link

commented Nov 12, 2016

Heads up! This PR modifies the following files:

  • @bholley: components/style/properties/shorthand/border.mako.rs, components/style/properties/longhand/border.mako.rs
  • @emilio: components/style/properties/shorthand/border.mako.rs, components/style/properties/longhand/border.mako.rs
@canova canova changed the title Implement border-image shorthand [WIP] Implement border-image shorthand Nov 12, 2016
@canova canova force-pushed the canova:border-image-shorthand branch from 338a8ab to bf64f83 Nov 13, 2016
@@ -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)),

This comment has been minimized.

Copy link
@Manishearth

Manishearth Nov 13, 2016

Member

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)),

This comment has been minimized.

Copy link
@Manishearth

Manishearth Nov 13, 2016

Member

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))

This comment has been minimized.

Copy link
@Manishearth

Manishearth Nov 13, 2016

Member

None for the second

pub fn get_initial_specified_value() -> SpecifiedValue {
SpecifiedValue {
corners: vec![PercentageOrNumber::Percentage(Percentage(1.0)),
PercentageOrNumber::Percentage(Percentage(1.0)),

This comment has been minimized.

Copy link
@Manishearth

Manishearth Nov 13, 2016

Member

same

slice = Some(value);

// Parse border image width and outset, if applicable.
try!(input.try(|input| {

This comment has been minimized.

Copy link
@Manishearth

Manishearth Nov 13, 2016

Member

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.

@canova canova force-pushed the canova:border-image-shorthand branch from bf64f83 to b1b4f7c Nov 13, 2016
@canova canova changed the title [WIP] Implement border-image shorthand Implement border-image shorthand Nov 13, 2016
@canova canova force-pushed the canova:border-image-shorthand branch from b1b4f7c to e408b0e Nov 13, 2016
@canova

This comment has been minimized.

Copy link
Member Author

commented Nov 14, 2016

r? @Manishearth Could you review when you're available? :)

@Manishearth

This comment has been minimized.

Copy link
Member

commented Nov 14, 2016

@bors-servo r+

looks good!

@bors-servo

This comment has been minimized.

Copy link
Contributor

commented Nov 14, 2016

📌 Commit e408b0e has been approved by Manishearth

@bors-servo

This comment has been minimized.

Copy link
Contributor

commented Nov 14, 2016

⌛️ Testing commit e408b0e with merge e9fa69b...

bors-servo added a commit that referenced this pull request Nov 14, 2016
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 -->
@bors-servo

This comment has been minimized.

Copy link
Contributor

commented Nov 14, 2016

@bors-servo bors-servo merged commit e408b0e into servo:master Nov 14, 2016
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@canova canova deleted the canova:border-image-shorthand branch Nov 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.