mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
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:
parent
5fcf3d0b05
commit
6584ae0080
Notes:
github-actions[bot]
2025-06-24 11:52:28 +00:00
Author: https://github.com/Calme1709
Commit: 6584ae0080
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5184
Reviewed-by: https://github.com/AtkinsSJ ✅
17 changed files with 157 additions and 11 deletions
|
@ -66,6 +66,7 @@ Parser::Parser(ParsingParams const& context, Vector<Token> tokens)
|
|||
, m_tokens(move(tokens))
|
||||
, m_token_stream(m_tokens)
|
||||
, m_rule_context(move(context.rule_context))
|
||||
, m_declared_namespaces(move(context.declared_namespaces))
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -141,6 +142,8 @@ GC::RootVector<GC::Ref<CSSRule>> Parser::convert_rules(Vector<Rule> const& raw_r
|
|||
|
||||
if (!namespace_rules_valid)
|
||||
continue;
|
||||
|
||||
m_declared_namespaces.set(as<CSSNamespaceRule>(*rule).prefix());
|
||||
break;
|
||||
default:
|
||||
import_rules_valid = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue