leptris 1.9.345.0-ppc64le-linux → 1.9.346.0-ppc64le-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 +4 -4
- data/CHANGELOG.md +29 -0
- data/Rakefile +52 -2
- data/TODO.final/04-native-bundle-codesign-artifact-sync.md +51 -0
- data/lib/leptris/version.rb +1 -1
- data/lib/libleptris.so +0 -0
- data/rakelib/audit_artifacts.rb +59 -0
- data/vendor-src/README.md +1 -1
- data/vendor-src/libleptris/CHANGELOG.md +20 -0
- data/vendor-src/libleptris/CMakeLists.txt +1 -1
- data/vendor-src/libleptris/src/leptris/dom/element.c +27 -0
- data/vendor-src/libleptris/src/leptris/dom/element_modify.c +30 -0
- data/vendor-src/libleptris/test/dom/test_dom.cpp +65 -0
- data/vendor-src/libleptris/vcpkg.json +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b358fe96893b880528d42ba0a708615616aa446733e0f31c205f4ee4d46043fb
|
|
4
|
+
data.tar.gz: f9b9115699471e36b0a9f9553d31a99c73ee1cc70a41d1629a6f4d27e4e524d5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 887eee320fca9a248cc81d484cec01bfc79f3644385d5ed9b3306457a864f7c4d7fa312564600d2a6f009357443524f965c9bb2a136b2a3f9329f560f669f334
|
|
7
|
+
data.tar.gz: 67495881774b7320b97f719b302b84db7882fb41c5b4154a0404090509a400666bb6ee903efdb22e168cafb382ecaad7291a7781c6b6b693203fcf8e044985a7
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
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
|
+
|
|
12
|
+
## [1.9.345.1] - 2026-10-12
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **TODO.final/04 gates — shipped-artifact codesign + artifact/
|
|
17
|
+
version sync (#388)**: `rake audit:artifacts` (darwin) fails on
|
|
18
|
+
an unsigned/tampered vendored macOS artifact (`codesign
|
|
19
|
+
--verify --strict` against the CURRENT bytes) and on
|
|
20
|
+
engine-version drift (the vendored library's
|
|
21
|
+
`leptris_version()` must equal the Rakefile pin — a half-bumped
|
|
22
|
+
lockstep state can no longer package; the drift path proved
|
|
23
|
+
itself live during development). The darwin platform-gem builds
|
|
24
|
+
ad-hoc sign as the last pre-package step (audit:artifacts
|
|
25
|
+
between compile and pack). Negative proof in
|
|
26
|
+
spec/audit_codesign_spec.rb: flipped-byte and
|
|
27
|
+
stripped-signature copies fail the strict gate; the version
|
|
28
|
+
gate flags drift and accepts the pin.
|
|
29
|
+
|
|
1
30
|
## [1.9.345.0] - 2026-10-12
|
|
2
31
|
|
|
3
32
|
### Fixed — engine sync (libleptris 1.9.345)
|
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.
|
|
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
|
|
@@ -404,6 +404,45 @@ namespace :audit do
|
|
|
404
404
|
end
|
|
405
405
|
end
|
|
406
406
|
|
|
407
|
+
# TODO.final/04: shipped-macOS-artifact gates — (a) the
|
|
408
|
+
# embedded signature verifies strictly against the CURRENT
|
|
409
|
+
# bytes (a copy/strip/recompress in packaging invalidates the
|
|
410
|
+
# linker's ad-hoc signature and this fails instead of a user
|
|
411
|
+
# machine's dlopen), (b) the vendored library's
|
|
412
|
+
# leptris_version() equals the gem's engine pin (a half-bumped
|
|
413
|
+
# lockstep state can no longer package). Negative proof lives
|
|
414
|
+
# in spec/audit_codesign_spec.rb.
|
|
415
|
+
desc "Fail on unsigned/tampered macOS artifacts or engine-version drift"
|
|
416
|
+
task :artifacts do
|
|
417
|
+
unless RUBY_PLATFORM =~ /darwin/
|
|
418
|
+
puts "audit:artifacts: skipped off-darwin (codesign gates " \
|
|
419
|
+
"the macOS packaging legs)"
|
|
420
|
+
next
|
|
421
|
+
end
|
|
422
|
+
abort "audit:artifacts: codesign unavailable" \
|
|
423
|
+
unless AuditArtifacts.codesign_available?
|
|
424
|
+
libs = AuditArtifacts.darwin_artifacts.select { |f| File.file?(f) }
|
|
425
|
+
abort "audit:artifacts: no vendored macOS artifacts found " \
|
|
426
|
+
"— run rake compile" if libs.empty?
|
|
427
|
+
libs.each do |lib|
|
|
428
|
+
unless AuditArtifacts.signature_ok?(lib)
|
|
429
|
+
abort "audit:artifacts: signature invalid or missing on " \
|
|
430
|
+
"#{lib} — ad-hoc sign before packaging"
|
|
431
|
+
end
|
|
432
|
+
end
|
|
433
|
+
main_lib = libs.find { |f| f.end_with?("libleptris.dylib") }
|
|
434
|
+
pinned = ENV.fetch("LIBLEPTRIS_VERSION", LIBLEPTRIS_VERSION)
|
|
435
|
+
unless AuditArtifacts.version_synced?(
|
|
436
|
+
main_lib, File.dirname(main_lib), pinned)
|
|
437
|
+
vendored = AuditArtifacts.vendored_version(
|
|
438
|
+
main_lib, File.dirname(main_lib))
|
|
439
|
+
abort "audit:artifacts: engine-version drift — vendored " \
|
|
440
|
+
"#{vendored.inspect} != pin #{pinned.inspect}"
|
|
441
|
+
end
|
|
442
|
+
puts "audit:artifacts: #{libs.size} macOS artifacts verify " \
|
|
443
|
+
"strictly and engine-synced (#{pinned})"
|
|
444
|
+
end
|
|
445
|
+
|
|
407
446
|
# Packaging doctrine (#271): every BUILT gem carries the engine
|
|
408
447
|
# source (vendor-src/libleptris build inputs) and the ext sources;
|
|
409
448
|
# platform gems additionally carry the prebuilt libraries and must
|
|
@@ -453,6 +492,8 @@ namespace :audit do
|
|
|
453
492
|
end
|
|
454
493
|
|
|
455
494
|
require "rubygems/package_task"
|
|
495
|
+
require_relative "rakelib/audit_artifacts"
|
|
496
|
+
require "open3"
|
|
456
497
|
|
|
457
498
|
desc "Build the pure-Ruby gem"
|
|
458
499
|
task "gem:native:any" do
|
|
@@ -499,7 +540,16 @@ platforms = [
|
|
|
499
540
|
platforms.each do |platform|
|
|
500
541
|
desc "Build pre-compiled gem for the #{platform} platform"
|
|
501
542
|
task "gem:native:#{platform}" do
|
|
502
|
-
|
|
543
|
+
if platform.end_with?("darwin")
|
|
544
|
+
# TODO.final/04: ad-hoc sign as the LAST step before the
|
|
545
|
+
# packager touches nothing else — the signature must cover
|
|
546
|
+
# the final bytes, and audit:artifacts verifies strictly.
|
|
547
|
+
sh "rake compile platform:#{platform}"
|
|
548
|
+
sh "rake audit:artifacts"
|
|
549
|
+
sh "rake platform:#{platform} gem"
|
|
550
|
+
else
|
|
551
|
+
sh "rake compile platform:#{platform} gem"
|
|
552
|
+
end
|
|
503
553
|
end
|
|
504
554
|
|
|
505
555
|
desc "Define the gem task to build on the #{platform} platform (binary gem)"
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# 04 — native-bundle codesign (macOS 14.1+) + artifact/version sync
|
|
2
|
+
|
|
3
|
+
Status: OPEN. Owner: this binding's owning session. Filed from the
|
|
4
|
+
engine-side investigation 2026-10-06 (leptris session); applies to
|
|
5
|
+
every `*-ruby` binding that ships prebuilt native artifacts.
|
|
6
|
+
|
|
7
|
+
## Problem
|
|
8
|
+
|
|
9
|
+
macOS 14.1+ on Apple Silicon kills unsigned or signature-invalidated
|
|
10
|
+
arm64 Mach-O libraries at load (`killed: 9`). CI-built arm64 dylibs
|
|
11
|
+
are linker-ad-hoc-signed, but any packaging step that COPIES or
|
|
12
|
+
re-compresses the artifact can strip/invalidate the ad-hoc
|
|
13
|
+
signature, and a prebuilt gem that installs an unsigned dylib then
|
|
14
|
+
fails at `dlopen` on user machines. Nothing in the current
|
|
15
|
+
packaging or audit path checks this.
|
|
16
|
+
|
|
17
|
+
## Work items
|
|
18
|
+
|
|
19
|
+
1. **Ad-hoc codesign at package time.** For every vendored macOS
|
|
20
|
+
arm64 (and universal) library the gem ships:
|
|
21
|
+
`codesign --force --sign - <lib>` as the LAST packaging step
|
|
22
|
+
(after any copy/strip/recompress), so the signature always
|
|
23
|
+
covers the final bytes. No Apple Developer identity is needed —
|
|
24
|
+
ad-hoc is sufficient for load validation.
|
|
25
|
+
2. **Verify in the audit gate.** Extend the existing
|
|
26
|
+
`rake audit` (the vendor-artifact validator: rake compile +
|
|
27
|
+
audit:symbols + CI) with `codesign --verify --strict` per
|
|
28
|
+
macOS library, so a tampered or unsigned artifact FAILS the
|
|
29
|
+
gate instead of a user machine.
|
|
30
|
+
3. **Artifact/version sync.** At package time (and in audit),
|
|
31
|
+
assert the vendored library's engine version —
|
|
32
|
+
`<engine>_version()` / the dylib's reported version — equals
|
|
33
|
+
the gem's pinned engine version. This closes the manual-pin
|
|
34
|
+
loop: a half-bumped lockstep release can no longer package.
|
|
35
|
+
|
|
36
|
+
## Acceptance
|
|
37
|
+
|
|
38
|
+
- Packaging workflow signs every macOS library it produces.
|
|
39
|
+
- Audit fails on (a) an unsigned/tampered macOS library, (b) a
|
|
40
|
+
vendored library whose version != the gem's engine pin.
|
|
41
|
+
- A deliberate negative test (unsigned copy) proves both gates.
|
|
42
|
+
|
|
43
|
+
## Notes
|
|
44
|
+
|
|
45
|
+
- Vendored artifacts are swapped by CI ONLY (the standing law):
|
|
46
|
+
these gates run inside the packaging/audit workflows, not as
|
|
47
|
+
local shortcuts.
|
|
48
|
+
- Source-compiled installs are unaffected: clang ad-hoc signs the
|
|
49
|
+
freshly built extension on the user's machine.
|
|
50
|
+
- Engine-side context: leptris/leptris session notes 2026-10-06;
|
|
51
|
+
the item is engine-family-wide (l/t/y bindings carry it too).
|
data/lib/leptris/version.rb
CHANGED
data/lib/libleptris.so
CHANGED
|
Binary file
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "open3"
|
|
4
|
+
require "rbconfig"
|
|
5
|
+
|
|
6
|
+
# TODO.final/04: the shipped-artifact gates. Required by
|
|
7
|
+
# Rakefile's audit:artifacts task and by the negative-proof specs
|
|
8
|
+
# (spec/audit_codesign_spec.rb). Not shipped in the gem — this is
|
|
9
|
+
# packaging/CI tooling.
|
|
10
|
+
module AuditArtifacts
|
|
11
|
+
module_function
|
|
12
|
+
|
|
13
|
+
# Every vendored macOS artifact the gem ships (the darwin
|
|
14
|
+
# packaging set, wherever it currently lives).
|
|
15
|
+
def darwin_artifacts
|
|
16
|
+
%w[
|
|
17
|
+
lib/libleptris.dylib
|
|
18
|
+
lib/libutf8proc.3.dylib
|
|
19
|
+
lib/leptris/xml/native.bundle
|
|
20
|
+
] + Dir.glob("lib/leptris/vendor/*-darwin/**/*.{dylib,bundle}")
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# (a) tamper gate: --strict verifies the embedded signature
|
|
24
|
+
# covers the CURRENT bytes; a copy/strip/recompress invalidates
|
|
25
|
+
# it and this fails instead of a user machine's dlopen.
|
|
26
|
+
def signature_ok?(path)
|
|
27
|
+
system("codesign", "--verify", "--strict", path,
|
|
28
|
+
out: File::NULL, err: File::NULL)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def codesign_available?
|
|
32
|
+
# codesign has no --version; `which`-style probe via -h
|
|
33
|
+
# (exit 1 with usage output still proves the binary exists —
|
|
34
|
+
# ENOENT returns nil).
|
|
35
|
+
!system("codesign", "-h", out: File::NULL, err: File::NULL).nil?
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# (b) artifact/version sync: the vendored library's own
|
|
39
|
+
# leptris_version() must equal the Rakefile's engine pin — a
|
|
40
|
+
# half-bumped lockstep state can no longer package. Runs the
|
|
41
|
+
# vendored library in an isolated interpreter (no gem load).
|
|
42
|
+
def vendored_version(lib, lib_dir)
|
|
43
|
+
env = { "LEPTRIS_LIB_PATH" => lib,
|
|
44
|
+
"DYLD_FALLBACK_LIBRARY_PATH" => lib_dir }
|
|
45
|
+
out, status = Open3.capture2e(env, RbConfig.ruby,
|
|
46
|
+
"-rffi", "-e",
|
|
47
|
+
'require "ffi"; ' \
|
|
48
|
+
'module V; extend FFI::Library; ' \
|
|
49
|
+
'ffi_lib ENV["LEPTRIS_LIB_PATH"]; ' \
|
|
50
|
+
'attach_function :v, :leptris_version, [], :string; end; ' \
|
|
51
|
+
'print V.v')
|
|
52
|
+
status.success? ? out.strip : nil
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def version_synced?(lib, lib_dir, pinned)
|
|
56
|
+
vendored = vendored_version(lib, lib_dir)
|
|
57
|
+
!vendored.nil? && vendored == pinned
|
|
58
|
+
end
|
|
59
|
+
end
|
data/vendor-src/README.md
CHANGED
|
@@ -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
|
|
@@ -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.
|
|
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.
|
|
4
|
+
version: 1.9.346.0
|
|
5
5
|
platform: ppc64le-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -69,6 +69,7 @@ files:
|
|
|
69
69
|
- LICENSE.md
|
|
70
70
|
- README.adoc
|
|
71
71
|
- Rakefile
|
|
72
|
+
- TODO.final/04-native-bundle-codesign-artifact-sync.md
|
|
72
73
|
- TODO.perf/01-ext-accelerated-default-reads.md
|
|
73
74
|
- TODO.perf/02-auto-enable-native-layer.md
|
|
74
75
|
- TODO.perf/03-bulk-xpath-result-materialization.md
|
|
@@ -189,6 +190,7 @@ files:
|
|
|
189
190
|
- lib/leptris/xml/xslt.rb
|
|
190
191
|
- lib/libleptris.so
|
|
191
192
|
- lib/libutf8proc.so.3
|
|
193
|
+
- rakelib/audit_artifacts.rb
|
|
192
194
|
- scripts/gem_smoke.rb
|
|
193
195
|
- vendor-src/README.md
|
|
194
196
|
- vendor-src/libleptris/CHANGELOG.md
|