leptris 1.9.373.0-aarch64-linux → 1.9.374.0-aarch64-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: b7bffda330a35b524779a0efaf9a3895a915ce5d754f5deaf6e9b74e95e488c6
4
- data.tar.gz: 79b40553a69437065ff7601d01e2b312a9f76322d2222f3b7f9fb5a4db6285cc
3
+ metadata.gz: f1cfdde9b79dc733fd841f7c812984e03a3b26da42ec56232dc0847d840fe7f6
4
+ data.tar.gz: a620bff9d9f386b970c6f7523119a5a7635e3d6d61b2d3d9170a8a1ac17ab6d4
5
5
  SHA512:
6
- metadata.gz: aa5a1a7b6c0c8dde4472fd88acad3b84801ebc95aea7920198ef12f2c722878d25276c189e5ddd44b5d94dd72879de15413a95c73986e6d84250a81b73dc5e78
7
- data.tar.gz: 184f4c98c62ecc3d98ce1e5a4b16be753246f059d03bee5d0cd07b46a49e3de2037613f447bd00a9769de1b8a80b73d3e4db46283e88e2056eebcde85bd231db
6
+ metadata.gz: 85e7d38d6393fd494646d20630b3bd31b8e35536c47b22b83c12277ecc6a431b82255e0cf191aeb3c87f5a5dd824fa064113d88a4e9c37989b9ee702f26676e5
7
+ data.tar.gz: 1913d5728de2ae72375de606fb48ca5b09b9964775468d5cf2f6c273d8079f9b359c71e34fc99eb377307aa664abebd519716b9285a2230543e1bce1d5bf65eb
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.373"
11
+ LIBLEPTRIS_VERSION = "1.9.374"
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.373.0"
4
+ VERSION = "1.9.374.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.373
4
+ - libleptris v1.9.374
5
5
  - utf8proc v2.11.0
6
6
 
7
7
  Rebuild by hand:
@@ -1,5 +1,23 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.9.374] - 2026-10-19
4
+
5
+ ### Fixed
6
+
7
+ - **dom: detached text mutations resolve their document
8
+ (moxml#401, PR #1785).** `Text#content=` on a detached text node
9
+ — subtree removed, node unlinked, or document-level stray text —
10
+ failed with `Invalid argument`. Three composed gaps: the
11
+ document resolver's parent walk stopped at a detached ancestor
12
+ instead of falling through to the node's #1320 owner stamp;
13
+ parse-carved text nodes were never stamped at all (only the
14
+ public creator stamped); and lazily-promoted documents had no
15
+ pool at mutation time. All parsed text stamps at carve now; a
16
+ detached mutation promotes the document. Red-first specs
17
+ (`DomTextMutate.*`); 100% of 2066 ctest.
18
+
19
+
20
+
3
21
  ## [1.9.373] - 2026-10-19
4
22
 
5
23
  ### Added
@@ -3,7 +3,7 @@
3
3
  cmake_minimum_required(VERSION 3.20)
4
4
 
5
5
  project(leptris
6
- VERSION 1.9.373
6
+ VERSION 1.9.374
7
7
  DESCRIPTION "Fast XML parser and XPath evaluator in pure C"
8
8
  LANGUAGES C CXX
9
9
  )
@@ -294,7 +294,13 @@ static LeptrisDocument node_public_document(LeptrisNodeRef node) {
294
294
  return leptris_element_get_document((LeptrisElement)node);
295
295
  }
296
296
  LeptrisElement parent = leptris_node_parent(node);
297
- if (parent) return leptris_element_get_document(parent);
297
+ if (parent) {
298
+ /* moxml#401: a DETACHED ancestor resolves to nothing — fall
299
+ * through to the node's own #1320 stamp instead of
300
+ * returning NULL from the parent's failed walk. */
301
+ LeptrisDocument pd = leptris_element_get_document(parent);
302
+ if (pd) return pd;
303
+ }
298
304
  /* Issue #519: detached non-element nodes carry their owning
299
305
  * document — mutations must work before any attach. Text was the
300
306
  * one kind #519 skipped (its pool backref covered it until #1285
@@ -413,7 +419,12 @@ LEPTRIS_API LeptrisStatus leptris_text_node_set_content(LeptrisNodeRef node,
413
419
  /* #1285 slice 4: the pool field is gone — allocate the
414
420
  * NUL-terminated copy from the owning document's pool. */
415
421
  LeptrisDocument doc = node_public_document(node);
416
- if (!doc || !doc->pool) return LEPTRIS_ERROR_INVALID_ARG;
422
+ if (!doc) return LEPTRIS_ERROR_INVALID_ARG;
423
+ /* TODO 139: lazily-promoted documents carry no pool until the
424
+ * promote runs — a detached mutation is the promote trigger
425
+ * (moxml#401). */
426
+ leptris_document_ensure_promoted(doc);
427
+ if (!doc->pool) return LEPTRIS_ERROR_INVALID_ARG;
417
428
  char* copy = node_public_pool_strdup(doc->pool, content, len);
418
429
  if (!copy) return LEPTRIS_ERROR_MEMORY;
419
430
  leptris_textnode_set_content_ptr_doc(t, copy, len, doc);
@@ -33,7 +33,15 @@ LeptrisTextNode* leptris_text_create(const char* content,
33
33
  node->base.raw = 0; /* uninitialized: see create_borrowed */
34
34
  node->parent_off = 0;
35
35
  node->next_sibling_off = 0;
36
- node->owner_doc_off = 0; /* #1320: only the public creator stamps */
36
+ /* moxml#401: stamp here when the doc is in hand — the #1320
37
+ * "only the public creator stamps" rule left every parse-carved
38
+ * and builder-created text unstamped, so a DETACHED text (its
39
+ * subtree removed) could not resolve its document for mutations
40
+ * (content= -> INVALID_ARG). */
41
+ node->owner_doc_off =
42
+ doc ? leptris_compact_int32_encode_doc(node, doc,
43
+ &node->owner_doc_off, doc)
44
+ : 0;
37
45
 
38
46
  if (content && content_len > 0) {
39
47
  memcpy(content_storage, content, content_len);
@@ -82,7 +90,13 @@ LeptrisTextNode* leptris_text_create_borrowed(const char* content,
82
90
  node->content_len = (uint32_t)content_len;
83
91
  node->parent_off = 0;
84
92
  node->next_sibling_off = 0;
85
- node->owner_doc_off = 0; /* #1320: only the public creator stamps */
93
+ /* moxml#401: same stamp — the borrowed flavor's doc tag is
94
+ * MANDATORY (its content pointer needs the doc-tagged fallback
95
+ * anyway), so the owner resolution must have it too. */
96
+ node->owner_doc_off =
97
+ doc ? leptris_compact_int32_encode_doc(node, doc,
98
+ &node->owner_doc_off, doc)
99
+ : 0;
86
100
 
87
101
  return node;
88
102
  }
@@ -1326,7 +1326,15 @@ static inline LeptrisTextNode* dp_text_create(DParser* p,
1326
1326
  tn->content_len = (uint32_t)content_len;
1327
1327
  tn->parent_off = 0;
1328
1328
  tn->next_sibling_off = 0;
1329
- tn->owner_doc_off = 0; /* #1320: parse-carved nodes attach */
1329
+ /* moxml#401: carve-time stamp — "attach will fix it" left every
1330
+ * parse-carved text unstamped forever (nothing re-stamps at
1331
+ * attach), so a DETACHED subtree's text could not resolve its
1332
+ * document for mutations. */
1333
+ tn->owner_doc_off =
1334
+ p->doc ? leptris_compact_int32_encode_doc(tn, p->doc,
1335
+ &tn->owner_doc_off,
1336
+ p->doc)
1337
+ : 0;
1330
1338
  return tn;
1331
1339
  }
1332
1340
 
@@ -3227,7 +3235,12 @@ static struct leptris_document* dp_il_build(
3227
3235
  * run is already NUL-terminated at carve) */
3228
3236
  tn->parent_off = 0;
3229
3237
  tn->next_sibling_off = 0;
3230
- tn->owner_doc_off = 0; /* #1320: parse-carved nodes attach */
3238
+ /* moxml#401: carve-time stamp (see the text carve). */
3239
+ tn->owner_doc_off =
3240
+ doc ? leptris_compact_int32_encode_doc(tn, doc,
3241
+ &tn->owner_doc_off,
3242
+ doc)
3243
+ : 0;
3231
3244
  smap[i] = (LeptrisNode*)tn;
3232
3245
  pp.depth = (int)rdepth[r->parent] + 1;
3233
3246
  pp.last_child_stack[pp.depth - 1] = lc[r->parent];
@@ -3386,3 +3386,47 @@ TEST(DomBasics, AttributesSnapshotEmptyAndNullContracts) {
3386
3386
 
3387
3387
  leptris_document_free(doc);
3388
3388
  }
3389
+
3390
+ /* moxml#401: Text#content= on a DETACHED text node (its subtree
3391
+ * removed, or the node itself unlinked) failed with INVALID_ARG —
3392
+ * the resolver's parent walk stopped at the detached ancestor and
3393
+ * the #1320 owner stamp was only set by the public creator, never
3394
+ * by the parse paths. Detached text mutations must reach the
3395
+ * owning document's pool. */
3396
+ TEST(DomTextMutate, DetachedSubtreeTextSetContent) {
3397
+ LeptrisStatus st;
3398
+ LeptrisDocument doc = leptris_parse_string(
3399
+ "<r><a>hello world</a></r>", 25, &st);
3400
+ ASSERT_NE(doc, nullptr);
3401
+ LeptrisNodeRef root = (LeptrisNodeRef)leptris_document_root(doc);
3402
+ ASSERT_NE(root, nullptr);
3403
+ LeptrisElement a = (LeptrisElement)leptris_node_first_child(root);
3404
+ ASSERT_NE(a, nullptr);
3405
+ LeptrisNodeRef t = leptris_node_first_child((LeptrisNodeRef)a);
3406
+ ASSERT_EQ(leptris_node_get_type(t), LEPTRIS_NODE_TYPE_TEXT);
3407
+
3408
+ /* detach the element subtree carrying the text */
3409
+ ASSERT_EQ(leptris_element_remove_child(
3410
+ (LeptrisElement)root, a),
3411
+ LEPTRIS_OK);
3412
+ EXPECT_EQ(leptris_text_node_set_content(t, "changed"), LEPTRIS_OK);
3413
+ const char* got = leptris_text_node_get_content(t);
3414
+ EXPECT_STREQ(got, "changed");
3415
+ leptris_document_free(doc);
3416
+ }
3417
+
3418
+ TEST(DomTextMutate, DetachedTextNodeSetContent) {
3419
+ LeptrisStatus st;
3420
+ LeptrisDocument doc = leptris_parse_string(
3421
+ "<r><a>hello world</a></r>", 25, &st);
3422
+ ASSERT_NE(doc, nullptr);
3423
+ LeptrisNodeRef root = (LeptrisNodeRef)leptris_document_root(doc);
3424
+ LeptrisElement a = (LeptrisElement)leptris_node_first_child(root);
3425
+ LeptrisNodeRef t = leptris_node_first_child((LeptrisNodeRef)a);
3426
+ /* unlink JUST the text from its parent */
3427
+ ASSERT_EQ(leptris_element_remove_child(
3428
+ a, (LeptrisElement)t),
3429
+ LEPTRIS_OK);
3430
+ EXPECT_EQ(leptris_text_node_set_content(t, "solo"), LEPTRIS_OK);
3431
+ leptris_document_free(doc);
3432
+ }
@@ -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.373",
4
+ "version": "1.9.374",
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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.373.0
4
+ version: 1.9.374.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-19 00:00:00.000000000 Z
11
+ date: 2026-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi