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

Fixes https://github.com/servo/servo/issues/15207
This commit is contained in:
Alberto Leal 2017-02-02 01:57:20 -05:00
parent 8b9dc9392b
commit 09d4751054
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.