diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index ac1a5dc581f..93efb36f1d6 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -678,8 +678,7 @@ fn static_assert() { } pub fn copy_border_${side.ident}_style_from(&mut self, other: &Self) { - self.gecko.mBorderStyle[${side.index}] = other.gecko.mBorderStyle[${side.index}]; - self.gecko.mComputedBorder.${side.ident} = self.gecko.mBorder.${side.ident}; + self.set_border_${side.ident}_style(other.gecko.mBorderStyle[${side.index}]); } pub fn reset_border_${side.ident}_style(&mut self, other: &Self) { @@ -809,9 +808,7 @@ fn static_assert() { } pub fn copy_outline_style_from(&mut self, other: &Self) { - // FIXME(emilio): Why doesn't this need to reset mActualOutlineWidth? - // Looks fishy. - self.gecko.mOutlineStyle = other.gecko.mOutlineStyle; + self.set_outline_style(other.gecko.mOutlineStyle); } pub fn reset_outline_style(&mut self, other: &Self) { diff --git a/components/style/style_adjuster.rs b/components/style/style_adjuster.rs index 9c5977dea1c..b4416abe179 100644 --- a/components/style/style_adjuster.rs +++ b/components/style/style_adjuster.rs @@ -435,19 +435,17 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> { properties::adjust_border_width(self.style); } - /// The initial value of outline-width may be changed at computed value time. + /// outline-style: none causes a computed outline-width of zero at computed + /// value time. fn adjust_for_outline(&mut self) { - if self - .style - .get_outline() - .clone_outline_style() - .none_or_hidden() && - self.style.get_outline().outline_has_nonzero_width() - { - self.style - .mutate_outline() - .set_outline_width(crate::Zero::zero()); + let outline = self.style.get_outline(); + if !outline.clone_outline_style().none_or_hidden() { + return; } + if !outline.outline_has_nonzero_width() { + return; + } + self.style.mutate_outline().set_outline_width(crate::Zero::zero()); } /// CSS overflow-x and overflow-y require some fixup as well in some cases.