leptris 1.9.345.1-arm-linux → 1.9.346.0-arm-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7336caa042d95a758103a546b9eaedae0d37795a8ab1cd670eee778b5a98aff4
4
- data.tar.gz: 8759521fec72ecffcd1337aa530c7bf1afd0b21108c969bdf7a8b8dec8bf99fc
3
+ metadata.gz: 751c1e3d50d3e40c6dd96028684d55eca69c6272dd03dd9389b62613510566c4
4
+ data.tar.gz: 6cfc3c8e46758c317f566b6380416556ad389b3d19d9425f53a293cdcf09a6bb
5
5
  SHA512:
6
- metadata.gz: ef5c3a26a396e8100a55aa410c973decd6cbdc6a719275554614f2afc2ea70b14f5eddce6c40e3c4aae91c66e2df3f2223f796afcc1dfddf249888f92a84f860
7
- data.tar.gz: 04b4f67f73bfbc31a57b63af7d6ffb469cf0416f946cad333fefcb33e4d461c099a7ebcacf2de5ad83451156a17b87195e51719c1f5c1f1069f086a2c2bff051
6
+ metadata.gz: 67e5220cefcc726114e164845810d7045944e65dc02671917113969f4dccbddffc1e382abdee0f8dc697883d45582938504ffc8b6b8c5c0fe16d4c1671c0c621
7
+ data.tar.gz: b1e7b65fa807a5bd00ab7dd37d286c6ef7c5c3841c87d9975f6dd3d95f218fd8612b395af6e5bb67b16ae926e150b1a313e4aae7032d9abe478d17cddf7b88b9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [1.9.346.0] - 2026-10-12
2
+
3
+ ### Fixed — engine sync (libleptris 1.9.346)
4
+
5
+ - **Reserved prefixes resolve on declaration-free trees (#1664)**:
6
+ xml:lang on an HTML/WHATWG-parsed tree and on mutation-created
7
+ attributes (element_set_attribute) resolves to the XML
8
+ namespace — both creation paths stamp the colon-gated attribute
9
+ ns side-cache like the XML parse lane's fused loop. Pinned for
10
+ both lanes through the binding API.
11
+
1
12
  ## [1.9.345.1] - 2026-10-12
2
13
 
3
14
  ### Added
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ RSpec::Core::RakeTask.new(:spec)
8
8
  # Pin for `rake compile` and the platform-gem builds. Keep in lockstep
9
9
  # with .github/workflows/build.yml (which calls `rake compile`) and the
10
10
  # CHANGELOG when libleptris releases.
11
- LIBLEPTRIS_VERSION = "1.9.345"
11
+ LIBLEPTRIS_VERSION = "1.9.346"
12
12
  # Vendored alongside libleptris for fn:normalize-unicode (TODO
13
13
  # .restructure/20): built per platform with a RELOCATABLE @rpath
14
14
  # install name, loaded by ffi.rb before libleptris so the
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.345.1"
4
+ VERSION = "1.9.346.0"
5
5
  end
data/lib/libleptris.so CHANGED
Binary file
data/vendor-src/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Sources vendored in this gem (recompile rights; the ruby
2
2
  variant builds them at install via extconf.rb):
3
3
 
4
- - libleptris v1.9.345
4
+ - libleptris v1.9.346
5
5
  - utf8proc v2.11.0
6
6
 
7
7
  Rebuild by hand:
@@ -1,5 +1,25 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.9.346] - 2026-10-12
4
+
5
+ ### Fixed
6
+
7
+ - **Reserved prefixes resolve on declaration-free trees
8
+ (leptris#1664, PR #1668).** leptris_attribute_namespace_uri
9
+ answered through the attribute's ns side-cache, but only the
10
+ XML parse lane stamped it - attributes created through
11
+ leptris_element_add_attribute (the HTML/WHATWG lane) and
12
+ leptris_element_set_attribute (the mutation API) carried no
13
+ cache, so xml:lang on an HTML-parsed tree resolved to no
14
+ namespace. Both creation paths now stamp the colon-gated
15
+ side-cache (owner element + pool-owned materialized prefix)
16
+ like the parse lane's fused loop; the reserved xml binding
17
+ then answers by definition (XML Namespaces 3) on every tree
18
+ flavor. moxml's wrapper-side fallback becomes dead weight.
19
+ Red-first specs for the WHATWG-parsed and mutation-created
20
+ shapes. Full suite 1990/1990.
21
+
22
+
3
23
  ## [1.9.345] - 2026-10-12
4
24
 
5
25
  ### Fixed
@@ -3,7 +3,7 @@
3
3
  cmake_minimum_required(VERSION 3.20)
4
4
 
5
5
  project(leptris
6
- VERSION 1.9.345
6
+ VERSION 1.9.346
7
7
  DESCRIPTION "Fast XML parser and XPath evaluator in pure C"
8
8
  LANGUAGES C CXX
9
9
  )
@@ -321,6 +321,33 @@ int leptris_element_add_attribute(LeptrisElement elem,
321
321
 
322
322
  leptris_attr_set_next(attr, NULL);
323
323
 
324
+ /* leptris#1664: prefixed names get their ns side-cache HERE
325
+ * (the parse lane stamps in its own fused loop; this path
326
+ * serves HTML-parsed and mutation-created attributes). The
327
+ * reserved xml prefix resolves by definition on
328
+ * declaration-free trees through elem_resolve_attr_prefix. */
329
+ {
330
+ const char* colon = (const char*)memchr(
331
+ attr->name_view.data, ':', attr->name_view.length);
332
+ if (colon) {
333
+ struct leptris_attr_ns_cache* c =
334
+ (struct leptris_attr_ns_cache*)leptris_pool_alloc(
335
+ pool, sizeof(*c));
336
+ if (c) {
337
+ memset(c, 0, sizeof(*c));
338
+ size_t pl = (size_t)(colon - attr->name_view.data);
339
+ char* pfx = (char*)leptris_pool_alloc(pool, pl + 1);
340
+ if (pfx) {
341
+ memcpy(pfx, attr->name_view.data, pl);
342
+ pfx[pl] = '\0';
343
+ c->prefix = pfx;
344
+ }
345
+ c->owner_elem = elem;
346
+ attr_set_ns_cache(attr, c);
347
+ }
348
+ }
349
+ }
350
+
324
351
  /* Append via cached last_attribute pointer (TODO 106).
325
352
  * Maintains the same invariant as leptris_element_set_attribute.
326
353
  * Decode the int32_t offset to access the struct, then update via
@@ -1422,6 +1422,36 @@ LeptrisStatus leptris_element_set_attribute(LeptrisElement elem, const char* nam
1422
1422
  attr->ns_cache_off = 0; /* TODO 173 */
1423
1423
  leptris_attr_set_next(attr, NULL);
1424
1424
 
1425
+ /* leptris#1664: prefixed names get their ns side-cache at
1426
+ * creation (reserved prefixes then resolve on
1427
+ * declaration-free/mutation trees). */
1428
+ {
1429
+ const char* colon = (const char*)memchr(
1430
+ name_storage, ':', nlen);
1431
+ if (colon) {
1432
+ struct leptris_memory_pool* spool =
1433
+ leptris_element_get_pool(elem);
1434
+ struct leptris_attr_ns_cache* c =
1435
+ (struct leptris_attr_ns_cache*)
1436
+ (spool ? leptris_pool_alloc(spool, sizeof(*c))
1437
+ : NULL);
1438
+ if (c) {
1439
+ memset(c, 0, sizeof(*c));
1440
+ size_t pl = (size_t)(colon - name_storage);
1441
+ char* pfx = spool
1442
+ ? (char*)leptris_pool_alloc(spool, pl + 1)
1443
+ : NULL;
1444
+ if (pfx) {
1445
+ memcpy(pfx, name_storage, pl);
1446
+ pfx[pl] = '\0';
1447
+ c->prefix = pfx;
1448
+ }
1449
+ c->owner_elem = elem;
1450
+ attr_set_ns_cache(attr, c);
1451
+ }
1452
+ }
1453
+ }
1454
+
1425
1455
  /* Append via the doc-level attr-tail cache — O(1) for the
1426
1456
  * sequential case (the element struct carries no last-attr
1427
1457
  * edge by the 64-byte layout law; the walk is O(attr_count)
@@ -4,6 +4,7 @@
4
4
 
5
5
  #include "leptris.h"
6
6
  #include "leptris/error.h"
7
+ #include "leptris/html.h"
7
8
  /* #1125 pristine-buffer gate: reach doc->xml_buffer directly. */
8
9
  #include "../leptris/leptris_internal.h"
9
10
  /* Internal root-doc-map surface (#1242 spec); C linkage. */
@@ -2160,6 +2161,70 @@ TEST(AttributeExpandedName, NsAccessorsAndLookup) {
2160
2161
  leptris_document_free(doc);
2161
2162
  }
2162
2163
 
2164
+ /* leptris#1664: the reserved xml prefix is bound by definition
2165
+ * (XML Namespaces 3) - no declaration needed, on every tree flavor.
2166
+ * HTML-parsed trees carry no xmlns declarations, so the namespace
2167
+ * face must still answer the reserved binding (and a declared
2168
+ * prefix on the XML tree keeps resolving as before). */
2169
+ TEST(DomAttributeNs, ReservedPrefixResolvesOnDeclarationFreeTrees) {
2170
+ const char html[] =
2171
+ "<html><body><span lang=\"en\" xml:lang=\"en\">t</span>"
2172
+ "</body></html>";
2173
+ LeptrisStatus st = LEPTRIS_OK;
2174
+ LeptrisDocument doc = leptris_parse_html_string(html, strlen(html), &st);
2175
+ ASSERT_NE(doc, nullptr) << "status " << (int)st;
2176
+ LeptrisElement root = leptris_document_root(doc);
2177
+ ASSERT_NE(root, nullptr);
2178
+ /* WHATWG lane builds its own wrapper shape — search the
2179
+ * subtree for the span. */
2180
+ LeptrisElement stack[32];
2181
+ int sp2 = 0;
2182
+ LeptrisElement span = nullptr;
2183
+ if (sp2 < 32) stack[sp2++] = root;
2184
+ while (sp2 > 0 && !span) {
2185
+ LeptrisElement e = stack[--sp2];
2186
+ if (strcmp(leptris_element_name(e), "span") == 0) {
2187
+ span = e;
2188
+ break;
2189
+ }
2190
+ for (LeptrisNodeRef c =
2191
+ leptris_node_first_child(leptris_element_as_node(e));
2192
+ c; c = leptris_node_next_sibling(c))
2193
+ if (leptris_node_get_type(c) == LEPTRIS_NODE_TYPE_ELEMENT &&
2194
+ sp2 < 32)
2195
+ stack[sp2++] = (LeptrisElement)c;
2196
+ }
2197
+ ASSERT_NE(span, nullptr);
2198
+ LeptrisAttribute found = nullptr;
2199
+ for (LeptrisAttribute a = leptris_element_first_attribute(span); a;
2200
+ a = leptris_attribute_next(a))
2201
+ if (strcmp(leptris_attribute_get_name(a), "xml:lang") == 0)
2202
+ found = a;
2203
+ ASSERT_NE(found, nullptr);
2204
+ EXPECT_STREQ(leptris_attribute_prefix(found), "xml");
2205
+ EXPECT_STREQ(leptris_attribute_namespace_uri(found),
2206
+ "http://www.w3.org/XML/1998/namespace");
2207
+ leptris_document_free(doc);
2208
+ }
2209
+
2210
+ TEST(DomAttributeNs, ReservedPrefixOnMutationCreatedAttribute) {
2211
+ /* The same unstamped-cache path: attributes created through the
2212
+ * DOM API (no parse lane) must resolve the reserved prefix. */
2213
+ LeptrisDocument doc = leptris_document_create();
2214
+ ASSERT_NE(doc, nullptr);
2215
+ LeptrisElement root = leptris_element_create(doc, "r");
2216
+ ASSERT_NE(root, nullptr);
2217
+ ASSERT_EQ(leptris_document_set_root(doc, root), LEPTRIS_OK);
2218
+ ASSERT_EQ(leptris_element_set_attribute(root, "xml:space", "preserve"),
2219
+ LEPTRIS_OK);
2220
+ LeptrisAttribute a = leptris_element_first_attribute(root);
2221
+ ASSERT_NE(a, nullptr);
2222
+ EXPECT_STREQ(leptris_attribute_prefix(a), "xml");
2223
+ EXPECT_STREQ(leptris_attribute_namespace_uri(a),
2224
+ "http://www.w3.org/XML/1998/namespace");
2225
+ leptris_document_free(doc);
2226
+ }
2227
+
2163
2228
  TEST(DetachedInserts, BuildBeforeAttach) {
2164
2229
  LeptrisDocument doc = leptris_document_create();
2165
2230
  ASSERT_NE(doc, nullptr);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
3
3
  "name": "leptris",
4
- "version": "1.9.345",
4
+ "version": "1.9.346",
5
5
  "description": "High-performance XML parser and XPath 1.0 engine in C (libleptris)",
6
6
  "homepage": "https://github.com/leptris/leptris",
7
7
  "license": "MIT",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.345.1
4
+ version: 1.9.346.0
5
5
  platform: arm-linux
6
6
  authors:
7
7
  - Ribose Inc.