Files
browser/src
Francis Bouvier d92cc849c3 selector: implement :link, :lang, :empty spec semantics; parser fixes
Fixes the remaining 30 failing subtests of WPT
/dom/nodes/Element-matches.html, in five clusters:

Matching (selector/List.zig):

- :link now matches a and area elements with an href attribute (in a
  headless browser no link is ever visited, so :visited stays
  unmatched and :link covers every hyperlink). :any-link gains the
  missing area case.
- :empty now ignores comment and processing-instruction children, per
  Selectors Level 3 only elements and non-empty text/cdata affect
  emptiness (<p><!-- comment --></p> is :empty, <p> </p> is not).
- :lang() is implemented: the element's language is the nearest
  ancestor-or-self lang attribute, falling back to the UA default (en)
  for elements in a document and to no language at all in detached
  subtrees, which is what the WPT expects for the detached/fragment
  contexts. Matching is ASCII case-insensitive on the exact tag or a
  `-` separated prefix (:lang(en) matches lang="en-AU").

Parsing (selector/Parser.zig):

- An empty selector-list segment ("div," or ",div") is now a parse
  error instead of being silently skipped.
- Unexpected EOF closes open attribute brackets per CSS Syntax:
  '#attr-value [align="center"' parses and matches.
- Attribute selectors accept a namespace component: [*|TiTlE] (any
  namespace) and [|title] (no namespace). Attributes are stored by
  qualified name and almost never namespaced, so both forms match by
  name; [*|*=test] stays invalid.

Coverage:
- /dom/nodes/Element-matches.html 639/669 -> 669/669 (fully green)
- /dom/nodes/ParentNode-querySelectors-namespaces.html 0/1 -> 1/1
- /dom/nodes/moveBefore/moveBefore-lang.html 0/1 -> 1/1
- /dom/nodes/moveBefore/Node-moveBefore.html 31/32 -> 32/32

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-11 13:19:12 +02:00
..
2026-07-14 15:15:10 +08:00
2026-07-14 11:55:59 +08:00
2026-07-08 10:19:38 +08:00
2026-07-14 11:32:52 +08:00
2026-07-14 09:17:14 +08:00
2026-07-09 20:59:58 +08:00
2026-07-14 09:17:14 +08:00
2026-06-24 18:16:02 +08:00
2026-07-14 09:17:14 +08:00
2026-05-29 09:32:03 +08:00
2026-04-10 06:51:10 +08:00
2026-07-14 09:17:14 +08:00
2026-07-14 09:17:14 +08:00
2026-07-02 11:23:45 +02:00
2026-07-14 09:17:14 +08:00
2026-07-14 11:32:52 +08:00
2026-07-10 07:35:36 +08:00
2026-07-14 11:45:17 +08:00
2026-05-25 18:05:11 +02:00
2026-01-24 07:59:41 +08:00
2026-07-14 14:19:27 +08:00