mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
LibWeb/CSS: Limit case-insensitive default comparison to HTML attributes
The HTML spec gives us a list of HTML attributes that must have their values compared case-insensitively by default (when the attribute selector does not specify a case-sensitiveness). However, ifwe have a namespace, then we are not looking for an HTML attribute, so this should not apply. Gets us 8 more WPT subtest passes.
This commit is contained in:
parent
d9113e45f0
commit
ecdfb96a0a
Notes:
github-actions[bot]
2025-05-16 15:43:04 +00:00
Author: https://github.com/AtkinsSJ
Commit: ecdfb96a0a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4756
Reviewed-by: https://github.com/shannonbooth
2 changed files with 11 additions and 10 deletions
|
@ -303,6 +303,7 @@ static inline bool matches_attribute(CSS::Selector::SimpleSelector::Attribute co
|
|||
// See: https://html.spec.whatwg.org/multipage/semantics-other.html#case-sensitivity-of-selectors
|
||||
if (element.document().is_html_document()
|
||||
&& element.namespace_uri() == Namespace::HTML
|
||||
&& attribute.qualified_name.namespace_type == CSS::Selector::SimpleSelector::QualifiedName::NamespaceType::Default
|
||||
&& attribute_name.is_one_of(
|
||||
HTML::AttributeNames::accept, HTML::AttributeNames::accept_charset, HTML::AttributeNames::align,
|
||||
HTML::AttributeNames::alink, HTML::AttributeNames::axis, HTML::AttributeNames::bgcolor, HTML::AttributeNames::charset,
|
||||
|
|
|
@ -2,8 +2,8 @@ Harness status: OK
|
|||
|
||||
Found 955 tests
|
||||
|
||||
926 Pass
|
||||
29 Fail
|
||||
934 Pass
|
||||
21 Fail
|
||||
Pass [foo='BAR'] /* sanity check (match) */ <div foo="BAR"> in standards mode
|
||||
Pass [foo='BAR'] /* sanity check (match) */ <div foo="BAR"> with querySelector in standards mode
|
||||
Pass [foo='bar'] /* sanity check (match) */ <div foo="bar"> in standards mode
|
||||
|
@ -115,10 +115,10 @@ Pass [id^='a'] /* sanity check (no match) */ <div id="AB"> in standards mode
|
|||
Pass [id^='a'] /* sanity check (no match) */ <div id="AB"> with querySelector in standards mode
|
||||
Pass [id$='A'] <div id="xa"> in standards mode
|
||||
Pass [id$='A'] <div id="xa"> with querySelector in standards mode
|
||||
Fail [*|lang='a'] /* sanity check (no match) */ <div {http://www.w3.org/XML/1998/namespace}lang="A"> in standards mode
|
||||
Fail [*|lang='a'] /* sanity check (no match) */ <div {http://www.w3.org/XML/1998/namespace}lang="A"> with querySelector in standards mode
|
||||
Fail [*|lang='A'] /* sanity check (no match) */ <div {http://www.w3.org/XML/1998/namespace}lang="a"> in standards mode
|
||||
Fail [*|lang='A'] /* sanity check (no match) */ <div {http://www.w3.org/XML/1998/namespace}lang="a"> with querySelector in standards mode
|
||||
Pass [*|lang='a'] /* sanity check (no match) */ <div {http://www.w3.org/XML/1998/namespace}lang="A"> in standards mode
|
||||
Pass [*|lang='a'] /* sanity check (no match) */ <div {http://www.w3.org/XML/1998/namespace}lang="A"> with querySelector in standards mode
|
||||
Pass [*|lang='A'] /* sanity check (no match) */ <div {http://www.w3.org/XML/1998/namespace}lang="a"> in standards mode
|
||||
Pass [*|lang='A'] /* sanity check (no match) */ <div {http://www.w3.org/XML/1998/namespace}lang="a"> with querySelector in standards mode
|
||||
Pass @namespace x 'http://www.w3.org/XML/1998/namespace'; [x|lang='A'] /* sanity check (no match) */ <div {http://www.w3.org/XML/1998/namespace}lang="a"> in standards mode
|
||||
Pass [foo='' i] <div foo="BAR"> in standards mode
|
||||
Pass [foo='' i] <div foo="BAR"> with querySelector in standards mode
|
||||
|
@ -436,10 +436,10 @@ Pass [id^='a'] /* sanity check (no match) */ <div id="AB"> in quirks mode
|
|||
Pass [id^='a'] /* sanity check (no match) */ <div id="AB"> with querySelector in quirks mode
|
||||
Pass [id$='A'] <div id="xa"> in quirks mode
|
||||
Pass [id$='A'] <div id="xa"> with querySelector in quirks mode
|
||||
Fail [*|lang='a'] /* sanity check (no match) */ <div {http://www.w3.org/XML/1998/namespace}lang="A"> in quirks mode
|
||||
Fail [*|lang='a'] /* sanity check (no match) */ <div {http://www.w3.org/XML/1998/namespace}lang="A"> with querySelector in quirks mode
|
||||
Fail [*|lang='A'] /* sanity check (no match) */ <div {http://www.w3.org/XML/1998/namespace}lang="a"> in quirks mode
|
||||
Fail [*|lang='A'] /* sanity check (no match) */ <div {http://www.w3.org/XML/1998/namespace}lang="a"> with querySelector in quirks mode
|
||||
Pass [*|lang='a'] /* sanity check (no match) */ <div {http://www.w3.org/XML/1998/namespace}lang="A"> in quirks mode
|
||||
Pass [*|lang='a'] /* sanity check (no match) */ <div {http://www.w3.org/XML/1998/namespace}lang="A"> with querySelector in quirks mode
|
||||
Pass [*|lang='A'] /* sanity check (no match) */ <div {http://www.w3.org/XML/1998/namespace}lang="a"> in quirks mode
|
||||
Pass [*|lang='A'] /* sanity check (no match) */ <div {http://www.w3.org/XML/1998/namespace}lang="a"> with querySelector in quirks mode
|
||||
Pass @namespace x 'http://www.w3.org/XML/1998/namespace'; [x|lang='A'] /* sanity check (no match) */ <div {http://www.w3.org/XML/1998/namespace}lang="a"> in quirks mode
|
||||
Pass [foo='' i] <div foo="BAR"> in quirks mode
|
||||
Pass [foo='' i] <div foo="BAR"> with querySelector in quirks mode
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue