Auto merge of #15357 - dashed:gh-15207, r=Wafflespeanut,emilio

Refactor outline-style to accept "auto" value in addition to border-style values.

Fixes https://github.com/servo/servo/issues/15207

Refactored as per https://github.com/servo/servo/issues/15207#issuecomment-275171590 .

<!-- Please describe your changes on the following line: -->

- [x] Correct refactor? I'd appreciate any feedback on this.
- [x] ~~~proper borderstyle value for `outline-style: auto;`?~~~ ~~~(EDIT: deferred to a `FIXME`)~~~ (EDIT2: it is now solid for behaviour parity with firefox)
- [x] squash pending PR review
- [x] mako code review

---
<!-- 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 #15207 (github issue number if applicable).

<!-- 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/15357)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-02-08 21:10:57 -08:00 committed by GitHub
commit 368af6f861
11 changed files with 164 additions and 26 deletions

View file

@ -1072,15 +1072,18 @@ impl FragmentDisplayListBuilding for Fragment {
style: &ServoComputedValues,
bounds: &Rect<Au>,
clip: &ClippingRegion) {
use style::values::Either;
let width = style.get_outline().outline_width;
if width == Au(0) {
return
}
let outline_style = style.get_outline().outline_style;
if outline_style == border_style::T::none {
return
}
let outline_style = match style.get_outline().outline_style {
Either::First(_auto) => border_style::T::solid,
Either::Second(border_style::T::none) => return,
Either::Second(border_style) => border_style
};
// Outlines are not accounted for in the dimensions of the border box, so adjust the
// absolute bounds.