LibWeb: Treat CSS selectors containing undeclared namespaces as invalid

Selectors containing undeclared namespaces should be considered invalid,
not just not matching any elements.

Gains us 3 new WPT passes.
This commit is contained in:
Callum Law 2025-06-23 22:40:37 +12:00 committed by Sam Atkins
commit 6584ae0080
Notes: github-actions[bot] 2025-06-24 11:52:28 +00:00
17 changed files with 157 additions and 11 deletions

View file

@ -81,6 +81,7 @@ struct ParsingParams {
ParsingMode mode { ParsingMode::Normal };
Vector<RuleContext> rule_context;
HashTable<FlyString> declared_namespaces;
};
// The very large CSS Parser implementation code is broken up among several .cpp files:
@ -543,6 +544,7 @@ private:
bool context_allows_quirky_length() const;
Vector<RuleContext> m_rule_context;
HashTable<FlyString> m_declared_namespaces;
Vector<PseudoClass> m_pseudo_class_context; // Stack of pseudo-class functions we're currently inside
};