Commit Graph

22 Commits

Author SHA1 Message Date
cff26b255d feat(xslt): attribute-set merging, copied namespaces, html booleans, loader entities
Same-name xsl:attribute-set declarations merge as ordered definitions
per 7.1.4, each expanding its used sets before its own attributes with
later definitions winning; xsl:copy carries the source element's
in-scope namespace nodes per 7.5; the namespace fixup lets a carried
attribute prefix shadow an inherited binding unless the element's own
name relies on it; the html method minimizes boolean attributes whose
value repeats their name; and external DTDs and entities in the
stylesheet or source resolve through the transform's document loader.
Four unit tests pin the behaviors. Xalan baseline 174 -> 159
(attribset 13 -> 4, copy 12 -> 7).
2026-06-10 16:11:02 +02:00
5a0c2ec7e4 feat(xslt): output methods in depth
disable-output-escaping on xsl:value-of and xsl:text (sentinel-marked
raw text, unescaped after serialization; string extraction from a
fragment drops the markers per 16.4), the html default method for a
null-namespace html root (16.1), the spec-default XML declaration for
the xml method, META Content-Type injection into head (16.2),
case-insensitive raw-text and void element classes, and HTML 4.01
Latin-1 named entities on html output. Whitespace-only stripping now
means XML whitespace, so NBSP-only text survives. Conf comparison
treats tag-adjacent whitespace as layout outside the canonical path.
Xalan baseline 371 -> 352 (output 49 -> 30).
2026-06-10 13:10:50 +02:00
067aa91861 fix(html): fragment parser reconstructs active formatting elements
The fragment TreeBuilder gains the HTML5 active-formatting-list and reconstruct
step that the document builder already had: when a formatting element (b, i,
em, ...) is closed out of order, it is remembered and re-opened for the
following content. So HTML.parse now agrees with HTML.parseDocument and the
spec, e.g. <b><i></b>X</i> -> <b><i></i></b><i>X</i> and
<p>1<b>2<i>3</b>4</i>5</p> -> <p>1<b>2<i>3</i></b><i>4</i>5</p>. The conformance
corpus that surfaced this now checks the fragment path directly.

Closes #109
2026-06-10 01:59:16 +02:00
a07537007e feat(html): vendor the complete WHATWG named entity set (#84) 2026-06-09 07:45:55 +02:00
7eb33c0d08 feat(html): full HTML 4.01 named entity set (#84) 2026-06-09 07:39:32 +02:00
a5b032e9dc feat(html): in-select-in-table closes select on table tags (#83) 2026-06-09 06:37:35 +02:00
3ebbaff07c feat(html): select content model (optgroup/nested-select/input close) (#83) 2026-06-09 06:32:24 +02:00
7add3b3fa5 refactor(html): build head on the live TreeNode model, remove DocFrame 2026-06-09 06:29:00 +02:00
b245640ee2 fix(html): keep template content nested instead of splitting to body (#83) 2026-06-09 06:21:10 +02:00
f637b8e154 feat(html): frameset documents and void frame element (#83) 2026-06-09 06:17:55 +02:00
2945de0855 feat(html): SVG HTML integration points switch back to HTML namespace (#83) 2026-06-09 06:06:54 +02:00
47e0e3e644 feat(html): table foster-parenting for stray content (#83) 2026-06-09 06:04:01 +02:00
038774cfc2 feat(html): SVG attribute-name case adjustment in foreign content (#83) 2026-06-09 05:52:26 +02:00
9092ab3dbd feat(html): adoption agency algorithm and active formatting elements (#83) 2026-06-09 05:46:12 +02:00
fccb407797 refactor(html): build body as a live mutable TreeNode open-elements stack (#83) 2026-06-09 05:35:26 +02:00
40c5973d5a feat(html): SVG element-name case adjustment in foreign content (#83) 2026-06-09 05:29:14 +02:00
d64bcaf2fa feat(html): SVG/MathML foreign-content namespace switching (#83) 2026-06-09 05:22:37 +02:00
b7f7e15fbc feat(html): table tree construction with implied tbody/tr (#83) 2026-06-09 05:18:13 +02:00
e86c87af3c feat(html): numeric-ref validation, NUL, RCDATA decoding, semicolon-less refs (#84) 2026-06-09 05:11:18 +02:00
6810c1c51a feat(html): add HTML5 document tree construction with insertion modes
Add parseDocument, which builds a full HTML document by the HTML5
tree-construction insertion modes (initial, before html, before head, in head,
after head, in body):

- the result always has an html root containing a head and a body, whether or
  not the source spelled those elements out.
- head-only elements (title, meta, link, base, style, script, and the rest)
  are routed into the head; flow content starts and fills the body.
- explicit html, head, and body tags and their attributes are honored.

The existing fragment parser (parse) is unchanged, so tag-soup fragments still
round-trip without an implied wrapper.

Closes #69
2026-06-08 09:24:11 +02:00
2f86b326cc chore: silence clean-build warnings
Use let for never-mutated bindings in DateTimeParser, HTMLEntities, and the
XSLT parser, and drop the redundant Unicode.Scalar Comparable conformance
that the standard library already provides. No behavior change.
2026-06-08 07:32:28 +02:00
cfba3ed7d2 feat(html): lenient HTML parser and serializer
Add the PureXML.HTML namespace: a lenient tokenizer for tag-soup input
(case-insensitive tags; quoted, unquoted, and boolean attributes; comments;
doctype; character references), a tree builder handling void elements,
optional end tags (li, p, table rows and cells), raw-text elements (script,
style), and unmatched end tags, and a serializer that writes void elements
unclosed and raw-text content unescaped.

Closes #36
Closes #37
Closes #38
Closes #39
Closes #20
2026-06-08 07:12:42 +02:00