Skip to content

Commit 6367dd9

Browse files
committed
Extra adjustments
1 parent 690b542 commit 6367dd9

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

ext/dom/lexbor/lexbor/selectors-adapted/selectors.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static bool lxb_selectors_str_cmp_loright(const char *lhs, const char *rhs)
5252
/* `name` is lowercase */
5353
static zend_always_inline bool lxb_selectors_cmp_html_name_lit(const xmlNode *node, const char *name)
5454
{
55-
return lxb_selectors_str_cmp_loright((const char *) node->name, name);
55+
return strcmp((const char *) node->name, name) == 0;
5656
}
5757

5858
static zend_always_inline bool lxb_selectors_adapted_cmp_ns(const xmlNode *a, const xmlNode *b)
@@ -61,7 +61,6 @@ static zend_always_inline bool lxb_selectors_adapted_cmp_ns(const xmlNode *a, co
6161
return a->ns == b->ns || (a->ns != NULL && b->ns != NULL && xmlStrEqual(a->ns->href, b->ns->href));
6262
}
6363

64-
/* From https://html.spec.whatwg.org/#case-sensitivity-of-selectors */
6564
static zend_always_inline bool lxb_selectors_adapted_cmp_local_name_id(const xmlNode *node, const lxb_selectors_adapted_id *id)
6665
{
6766
ZEND_ASSERT(node->doc != NULL);

ext/dom/tests/modern/css_selectors/pseudo_classes_links.phpt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ $dom = DOM\XMLDocument::createFromString(<<<XML
1111
<container>
1212
<a href="http://example.com">Link</a>
1313
<a xmlns="http://www.w3.org/1999/xhtml" href="http://example.com">Link</a>
14+
<A xmlns="http://www.w3.org/1999/xhtml" href="http://example.com">Not actually a link</A>
1415
<area xmlns="http://www.w3.org/1999/xhtml" href="http://example.com">Link</area>
1516
</container>
1617
XML);
1718

1819
test_helper($dom, ':any-link');
1920
test_helper($dom, ':link');
2021
test_helper($dom, 'a:not(:any-link)');
22+
test_helper($dom, ':not(:any-link)');
2123

2224
?>
2325
--EXPECT--
@@ -29,3 +31,12 @@ test_helper($dom, 'a:not(:any-link)');
2931
<area xmlns="http://www.w3.org/1999/xhtml" href="http://example.com">Link</area>
3032
--- Selector: a:not(:any-link) ---
3133
<a href="http://example.com">Link</a>
34+
--- Selector: :not(:any-link) ---
35+
<container>
36+
<a href="http://example.com">Link</a>
37+
<a xmlns="http://www.w3.org/1999/xhtml" href="http://example.com">Link</a>
38+
<A xmlns="http://www.w3.org/1999/xhtml" href="http://example.com">Not actually a link</A>
39+
<area xmlns="http://www.w3.org/1999/xhtml" href="http://example.com">Link</area>
40+
</container>
41+
<a href="http://example.com">Link</a>
42+
<A xmlns="http://www.w3.org/1999/xhtml" href="http://example.com">Not actually a link</A>

0 commit comments

Comments
 (0)