From 53ec2ace23495e2db69b5845d2712a8e5114ea13 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 16 Feb 2022 19:47:58 +0000 Subject: [PATCH] LibWeb: Explain discrepancy with media-query parsing This had me confused for a while, but I am not smart enough today to actually fix it properly. :^) --- Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index a57996149c..d5154baed4 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -1124,6 +1124,9 @@ OwnPtr Parser::parse_media_in_parens(TokenStream` + // FIXME: We should only be taking this branch if the grammar doesn't match the above options. + // Currently we take it if the above fail to parse, which is different. + // eg, `@media (min-width: 76yaks)` is valid grammar, but does not parse because `yaks` isn't a unit. if (auto maybe_general_enclosed = parse_general_enclosed(tokens); maybe_general_enclosed.has_value()) return MediaCondition::from_general_enclosed(maybe_general_enclosed.release_value());