From 17b52a6cf252ee1c66e60a673dd8a925afd81d98 Mon Sep 17 00:00:00 2001 From: zyxwvu Shi Date: Wed, 17 Jan 2024 22:00:00 +0800 Subject: [PATCH] media_query: Treat unknown media type as none According to https://www.w3.org/TR/mediaqueries-5/ section 3.2, Error Handling, an unknown media-type must be treated as not matching. --- src/media_query.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/media_query.cpp b/src/media_query.cpp index 7cddb15a2..8c2afff27 100644 --- a/src/media_query.cpp +++ b/src/media_query.cpp @@ -88,8 +88,7 @@ litehtml::media_query::ptr litehtml::media_query::create_from_string(const strin } } else { - query->m_media_type = (media_type) value_index(token, media_type_strings, media_type_all); - + query->m_media_type = (media_type) value_index(token, media_type_strings, media_type_none); } }