mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +00:00
LibWeb/CSS: Match *-namespace selectors against all attributes
Previously we only matched against the first attribute with a given local name. What we actually want to do is look at each attribute with that local name in turn and only return false if none of them match. Also remove a hack for HTML elements in HTML documents, where we would refuse to match any namespaced attributes. This doesn't seem to be based on the spec, but we had regressions without it, until now. :^) Gets us 21 more WPT subtest passes.
This commit is contained in:
parent
ecdfb96a0a
commit
869abe0b21
Notes:
github-actions[bot]
2025-05-16 15:42:59 +00:00
Author: https://github.com/AtkinsSJ
Commit: 869abe0b21
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4756
Reviewed-by: https://github.com/shannonbooth
4 changed files with 132 additions and 126 deletions
|
@ -194,16 +194,6 @@ Attr const* NamedNodeMap::get_attribute_ns(Optional<FlyString> const& namespace_
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
Attr const* NamedNodeMap::get_attribute_namespace_agnostic(FlyString const& local_name) const
|
||||
{
|
||||
for (auto const& attribute : m_attributes) {
|
||||
if (attribute->local_name() == local_name)
|
||||
return attribute.ptr();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#concept-element-attributes-set
|
||||
WebIDL::ExceptionOr<GC::Ptr<Attr>> NamedNodeMap::set_attribute(Attr& attribute)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue