File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -2176,7 +2176,7 @@ impl ComputedValuesInner {
21762176
21772177 /// Gets the logical computed margin from this style.
21782178 #[ inline]
2179- pub fn logical_margin( & self ) -> LogicalMargin <<& computed:: LengthPercentageOrAuto > {
2179+ pub fn logical_margin( & self ) -> LogicalMargin <<& computed:: Margin > {
21802180 let margin_style = self . get_margin ( ) ;
21812181 LogicalMargin :: from_physical ( self . writing_mode , SideOffsets2D :: new (
21822182 & margin_style. margin_top ,
Original file line number Diff line number Diff line change @@ -532,6 +532,27 @@ pub enum GenericMargin<LP> {
532532 ) ,
533533}
534534
535+ #[ cfg( feature = "servo" ) ]
536+ impl < LP > GenericMargin < LP > {
537+ /// Return true if it is 'auto'.
538+ #[ inline]
539+ pub fn is_auto ( & self ) -> bool {
540+ matches ! ( self , Self :: Auto )
541+ }
542+ }
543+
544+ #[ cfg( feature = "servo" ) ]
545+ impl GenericMargin < crate :: values:: computed:: LengthPercentage > {
546+ /// Returns true if the computed value is absolute 0 or 0%.
547+ #[ inline]
548+ pub fn is_definitely_zero ( & self ) -> bool {
549+ match self {
550+ Self :: LengthPercentage ( lp) => lp. is_definitely_zero ( ) ,
551+ _ => false ,
552+ }
553+ }
554+ }
555+
535556impl < LP > SpecifiedValueInfo for GenericMargin < LP >
536557where
537558 LP : SpecifiedValueInfo ,
You can’t perform that action at this time.
0 commit comments