LibWeb/CSS: Make media type and feature evaluation combination explicit

Functionally this is the same before, as result is always True or False
before this point, and `True && Foo` evaluates to `Foo`. But this is
more clearly correct, instead of correct by coincidence.
This commit is contained in:
Sam Atkins 2025-05-22 11:37:59 +01:00
parent a4d3c62524
commit b577302f07
Notes: github-actions[bot] 2025-05-23 09:19:31 +00:00
2 changed files with 42 additions and 5 deletions

View file

@ -305,8 +305,8 @@ bool MediaQuery::evaluate(HTML::Window const& window)
MatchResult result = matches_media(m_media_type);
if ((result == MatchResult::True) && m_media_condition)
result = m_media_condition->evaluate(&window);
if ((result != MatchResult::False) && m_media_condition)
result = result && m_media_condition->evaluate(&window);
if (m_negated)
result = negate(result);