diff --git a/apps/wpt/src/main.rs b/apps/wpt/src/main.rs index e3d870e9..753a9549 100644 --- a/apps/wpt/src/main.rs +++ b/apps/wpt/src/main.rs @@ -38,8 +38,9 @@ bitflags! { pub struct TestFlags : u32 { const USES_FLOAT = 0b00000001; const USES_INTRINSIC_SIZE = 0b00000010; - const USES_DIRECTION = 0b00000100; - const USES_WRITING_MODE = 0b00001000; + const USES_CALC = 0b00000100; + const USES_DIRECTION = 0b00001000; + const USES_WRITING_MODE = 0b00010000; } } @@ -175,6 +176,7 @@ struct ThreadCtx { attrtest_re: Regex, float_re: Regex, intrinsic_re: Regex, + calc_re: Regex, direction_re: Regex, writing_mode_re: Regex, out_dir: PathBuf, @@ -222,6 +224,9 @@ impl TestResult { if self.flags.contains(TestFlags::USES_INTRINSIC_SIZE) { write!(out, "{}", "I".bright_black()).unwrap(); } + if self.flags.contains(TestFlags::USES_CALC) { + write!(out, "{}", "C".bright_black()).unwrap(); + } if self.flags.contains(TestFlags::USES_DIRECTION) { write!(out, "{}", "D".bright_black()).unwrap(); } @@ -300,6 +305,7 @@ fn main() { let float_re = Regex::new(r#"float:"#).unwrap(); let intrinsic_re = Regex::new(r#"(width|height): ?(min|max|fit)-content"#).unwrap(); + let calc_re = Regex::new(r#"calc\("#).unwrap(); let direction_re = Regex::new(r#"direction:"#).unwrap(); let writing_mode_re = Regex::new(r#"writing-mode:"#).unwrap(); @@ -323,6 +329,7 @@ fn main() { attrtest_re, float_re, intrinsic_re, + calc_re, direction_re, writing_mode_re, out_dir: out_dir.clone(), @@ -439,6 +446,9 @@ async fn process_test_file( if ctx.intrinsic_re.is_match(&file_contents) { flags |= TestFlags::USES_INTRINSIC_SIZE; } + if ctx.calc_re.is_match(&file_contents) { + flags |= TestFlags::USES_CALC; + } if ctx.direction_re.is_match(&file_contents) { flags |= TestFlags::USES_DIRECTION; }