From 83daac57fd5db1efd0272eb14a54d91cf4ab61a3 Mon Sep 17 00:00:00 2001 From: s-maurice <51819025+s-maurice@users.noreply.github.com> Date: Wed, 23 Mar 2022 12:20:05 +0100 Subject: [PATCH] add custom debug formatting for display Signed-off-by: s-maurice <51819025+s-maurice@users.noreply.github.com> --- components/style/values/specified/box.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/components/style/values/specified/box.rs b/components/style/values/specified/box.rs index b3a49d17bb0..e30ea5215d0 100644 --- a/components/style/values/specified/box.rs +++ b/components/style/values/specified/box.rs @@ -18,7 +18,7 @@ use crate::Atom; use cssparser::Parser; use num_traits::FromPrimitive; use selectors::parser::SelectorParseErrorKind; -use std::fmt::{self, Write}; +use std::fmt::{self, Debug, Formatter, Write}; use style_traits::{CssWriter, KeywordsCollectFn, ParseError}; use style_traits::{SpecifiedValueInfo, StyleParseErrorKind, ToCss}; @@ -121,7 +121,6 @@ pub enum DisplayInside { #[derive( Clone, Copy, - Debug, Eq, FromPrimitive, Hash, @@ -657,6 +656,16 @@ impl SpecifiedValueInfo for Display { } } +impl Debug for Display { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("Display") + .field("List Item", &self.is_list_item()) + .field("Inside", &self.inside()) + .field("Outside", &self.outside()) + .finish() + } +} + /// A specified value for the `vertical-align` property. pub type VerticalAlign = GenericVerticalAlign;