makiri 0.15.0-aarch64-linux → 0.16.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 +4 -4
- data/CHANGELOG.md +27 -0
- data/lib/makiri/3.2/makiri.so +0 -0
- data/lib/makiri/3.3/makiri.so +0 -0
- data/lib/makiri/3.4/makiri.so +0 -0
- data/lib/makiri/4.0/makiri.so +0 -0
- data/lib/makiri/version.rb +1 -1
- data/lib/makiri.rb +27 -8
- data/script/check_unsafe_boundaries.rb +43 -35
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 651fa28c960d1fd0099870394fc7f19bef09e328ac4851d7102ebfbf9136a6a7
|
|
4
|
+
data.tar.gz: e84db4b38c9fbe3184b90cee36976b005521dfdca1165d10adf1c70970a36918
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9d9e73501a9744ecf0b16610f52cdf0f8ed17473914654b5bf719cdf3e84fd333cbe77f12305b0d0be9d52da6a9652a659c7a970e0a6e317a98edbe8b4c84b6c
|
|
7
|
+
data.tar.gz: 11627962979c3a7649f3ce09fc4bd5b7bc019626c675263ae73bae9434ebd003b565d9726bb0e8d0d497c80c01bbebfd79c0b677e40f894dcbad1135749b7e53
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.16.0] - 2026-10-10
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
* `Makiri::NATIVE_VERSION` and `Makiri::NATIVE_RUBY_API_VERSION`: the gem
|
|
8
|
+
version and Ruby `MAJOR.MINOR` the native extension was built as.
|
|
9
|
+
`require "makiri"` raises `LoadError` for an extension built for another
|
|
10
|
+
Ruby (refused by the extension itself, before it defines anything) or as
|
|
11
|
+
another makiri version (e.g. a stale `lib/makiri/makiri.bundle` in a
|
|
12
|
+
checkout).
|
|
13
|
+
* `Node#child_count`, `#child_at(i)`, `#element_child_count` and
|
|
14
|
+
`#element_child_at(i)` (HTML and XML): count and index a child list without
|
|
15
|
+
building `#children`. A loop over the indexes in order costs O(1) a step,
|
|
16
|
+
also while other lists are read in between. Any child-list edit in the
|
|
17
|
+
document resets that, so a loop that edits as it indexes walks from the
|
|
18
|
+
nearer end after each edit. `child_at` returns nil for a negative index or
|
|
19
|
+
one past the end.
|
|
20
|
+
* `Node#first_child` (an alias of `#child`) and `#last_child`.
|
|
21
|
+
* `Node#root_node`, DOM `getRootNode()`: the Document, a DocumentFragment, or
|
|
22
|
+
the top of a detached subtree. An Attr is its own root.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
* `#local_name`, `#prefix`, `#namespace_uri` and `#tag_name` return frozen,
|
|
27
|
+
interned Strings: every read of one name returns the same object. `#name`
|
|
28
|
+
still returns a new, mutable String.
|
|
29
|
+
|
|
3
30
|
## [0.15.0] - 2026-10-09
|
|
4
31
|
|
|
5
32
|
### Added
|
data/lib/makiri/3.2/makiri.so
CHANGED
|
Binary file
|
data/lib/makiri/3.3/makiri.so
CHANGED
|
Binary file
|
data/lib/makiri/3.4/makiri.so
CHANGED
|
Binary file
|
data/lib/makiri/4.0/makiri.so
CHANGED
|
Binary file
|
data/lib/makiri/version.rb
CHANGED
data/lib/makiri.rb
CHANGED
|
@@ -2,17 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
require_relative "makiri/version"
|
|
4
4
|
|
|
5
|
-
# Native extension (a Rust crate)
|
|
6
|
-
# (
|
|
7
|
-
#
|
|
8
|
-
# is
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
# Native extension (a Rust crate): lib/makiri/<major.minor>/makiri.<dlext> in a
|
|
6
|
+
# precompiled gem (one per Ruby), else lib/makiri/makiri.<dlext> (a source
|
|
7
|
+
# install, or a checkout's `rake compile`). The versioned one is required only
|
|
8
|
+
# if it is there: rescuing LoadError instead would also swallow the extension's
|
|
9
|
+
# own refusal (a binary built for another Ruby raises LoadError from its init)
|
|
10
|
+
# and load the fallback over it.
|
|
11
|
+
versioned = "makiri/#{RUBY_VERSION[/\A\d+\.\d+/]}/makiri"
|
|
12
|
+
if File.exist?(File.join(__dir__, "#{versioned}.#{RbConfig::CONFIG["DLEXT"]}"))
|
|
13
|
+
require_relative versioned
|
|
14
|
+
else
|
|
13
15
|
require_relative "makiri/makiri"
|
|
14
16
|
end
|
|
15
17
|
|
|
18
|
+
# The fallback loads lib/makiri/makiri.<dlext> whichever version of this gem's
|
|
19
|
+
# Ruby code is asking: a checkout (or a Bundler `path:` gem) keeps one binary
|
|
20
|
+
# from its last compile, and one from another gem version lacks or misnames
|
|
21
|
+
# methods. The extension states what it was built as, and a mismatch stops
|
|
22
|
+
# here; a binary older than the constant states nothing, a mismatch too. (A
|
|
23
|
+
# binary for another Ruby never gets this far: the extension refuses it
|
|
24
|
+
# before it defines anything.)
|
|
25
|
+
module Makiri
|
|
26
|
+
native_version = const_defined?(:NATIVE_VERSION, false) ? NATIVE_VERSION : "(unknown)"
|
|
27
|
+
if native_version != VERSION
|
|
28
|
+
raise LoadError,
|
|
29
|
+
"makiri's native extension was built as makiri #{native_version}, but was " \
|
|
30
|
+
"loaded by makiri #{VERSION}; rebuild it (`bundle exec rake clean compile` in a " \
|
|
31
|
+
"checkout, or reinstall the gem)"
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
16
35
|
require_relative "makiri/error"
|
|
17
36
|
require_relative "makiri/clone_via_dup"
|
|
18
37
|
require_relative "makiri/xpath_syntax"
|
|
@@ -33,12 +33,12 @@ UNSAFE_ISLANDS = {
|
|
|
33
33
|
"bridge/doc.rs" => 3,
|
|
34
34
|
"bridge/fragment.rs" => 6,
|
|
35
35
|
"bridge/gvl.rs" => 5,
|
|
36
|
-
"bridge/html.rs" =>
|
|
36
|
+
"bridge/html.rs" => 18,
|
|
37
37
|
"bridge/node_set.rs" => 8,
|
|
38
38
|
"bridge/node_wrap.rs" => 1,
|
|
39
|
-
"bridge/ruby.rs" =>
|
|
39
|
+
"bridge/ruby.rs" => 19,
|
|
40
40
|
"bridge/stack.rs" => 1,
|
|
41
|
-
"bridge/string.rs" =>
|
|
41
|
+
"bridge/string.rs" => 31,
|
|
42
42
|
"bridge/typed.rs" => 21,
|
|
43
43
|
"bridge/wrapper.rs" => 20,
|
|
44
44
|
"bridge/xml.rs" => 11,
|
|
@@ -90,37 +90,37 @@ UNSAFE_ISLANDS = {
|
|
|
90
90
|
FORBID_ROOTS = %w[css/mod.rs glue/mod.rs lexbor/css_match/mod.rs xml/mod.rs xpath/mod.rs].freeze
|
|
91
91
|
|
|
92
92
|
FORBID_FILES = %w[
|
|
93
|
-
bridge/dom_error.rs
|
|
94
|
-
css/
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
glue/html_node/
|
|
98
|
-
glue/
|
|
99
|
-
glue/
|
|
100
|
-
glue/xml_node/
|
|
101
|
-
glue/xml_node/
|
|
102
|
-
glue/xpath_context.rs lexbor/adapter/dom_index.rs
|
|
103
|
-
lexbor/css_match/mod.rs lexbor/selector_text.rs
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
xml/chars/
|
|
108
|
-
xml/
|
|
109
|
-
xml/
|
|
110
|
-
xml/mutate/
|
|
111
|
-
xml/mutate/
|
|
112
|
-
xml/
|
|
113
|
-
xml/serialize/
|
|
114
|
-
xml/
|
|
115
|
-
xml/tree/
|
|
116
|
-
xml/
|
|
117
|
-
xpath/
|
|
118
|
-
xpath/
|
|
119
|
-
xpath/
|
|
120
|
-
xpath/
|
|
121
|
-
xpath/
|
|
122
|
-
xpath/
|
|
123
|
-
xpath/value.rs xpath/verify.rs
|
|
93
|
+
bridge/dom_error.rs child_index.rs css/build.rs
|
|
94
|
+
css/lower.rs css/mod.rs cutf8.rs
|
|
95
|
+
cutf8/verify.rs dom_rules.rs engine_error.rs
|
|
96
|
+
falloc/verify.rs glue/css.rs glue/html_doc.rs
|
|
97
|
+
glue/html_node/css.rs glue/html_node/mutate.rs glue/html_node/read.rs
|
|
98
|
+
glue/html_node/serialize.rs glue/mod.rs glue/node.rs
|
|
99
|
+
glue/node_set.rs glue/query.rs glue/xml_doc.rs
|
|
100
|
+
glue/xml_node/css.rs glue/xml_node/mod.rs glue/xml_node/mutate.rs
|
|
101
|
+
glue/xml_node/ns.rs glue/xml_node/read.rs glue/xml_node/serialize.rs
|
|
102
|
+
glue/xml_node/strings.rs glue/xpath_context.rs lexbor/adapter/dom_index.rs
|
|
103
|
+
lexbor/contains_guard.rs lexbor/css_match/mod.rs lexbor/selector_text.rs
|
|
104
|
+
limits.rs node_type.rs ptr_table.rs
|
|
105
|
+
rust_tests.rs stack.rs text.rs
|
|
106
|
+
utf8_input.rs xml/arena.rs xml/attr_key.rs
|
|
107
|
+
xml/chars/expand.rs xml/chars/mod.rs xml/dom_name.rs
|
|
108
|
+
xml/encoding_sniff.rs xml/index.rs xml/mod.rs
|
|
109
|
+
xml/model.rs xml/mutate/attr.rs xml/mutate/copy.rs
|
|
110
|
+
xml/mutate/edit.rs xml/mutate/factory.rs xml/mutate/insert.rs
|
|
111
|
+
xml/mutate/mod.rs xml/mutate/ns.rs xml/ns_scope.rs
|
|
112
|
+
xml/qname.rs xml/selftest.rs xml/serialize/bindings.rs
|
|
113
|
+
xml/serialize/c14n.rs xml/serialize/mod.rs xml/serialize/out.rs
|
|
114
|
+
xml/serialize/xml.rs xml/tree/cursor.rs xml/tree/decl.rs
|
|
115
|
+
xml/tree/dtd.rs xml/tree/mod.rs xml/tree/scope.rs
|
|
116
|
+
xml/verify.rs xml/xpath.rs xpath/abi.rs
|
|
117
|
+
xpath/ast.rs xpath/ast_ops.rs xpath/attr_pred.rs
|
|
118
|
+
xpath/axis.rs xpath/ctx.rs xpath/dom.rs
|
|
119
|
+
xpath/eval.rs xpath/funcs/ext.rs xpath/funcs/mod.rs
|
|
120
|
+
xpath/lex.rs xpath/limits.rs xpath/mod.rs
|
|
121
|
+
xpath/nodetest.rs xpath/number.rs xpath/order.rs
|
|
122
|
+
xpath/parse.rs xpath/step_index.rs xpath/str_cache.rs
|
|
123
|
+
xpath/tests.rs xpath/value.rs xpath/verify.rs
|
|
124
124
|
].freeze
|
|
125
125
|
|
|
126
126
|
UNSAFE_USE = /\bunsafe\s*(?:\{|fn\b|impl\b|trait\b|extern\b)/
|
|
@@ -166,7 +166,11 @@ RAW_NODE_CROSSING_COUNTS = {
|
|
|
166
166
|
"bridge/fragment.rs" => 3,
|
|
167
167
|
# 8th: an Attr's owner, read as the wrapper cache's identity key for the
|
|
168
168
|
# owner-frozen check (`check_attr_owner_frozen`); it does not escape.
|
|
169
|
-
|
|
169
|
+
# 9th/10th: `TokenTree for HtmlTree` (`child_count` / `child_at`), a node's pointer as
|
|
170
|
+
# the child-position memo's token and back. `child_index::ChildPositionMemo`
|
|
171
|
+
# answers only for the `tree_version` it was filled under, so a token read
|
|
172
|
+
# back is still that child; the node is never handed out raw, only wrapped.
|
|
173
|
+
"bridge/html.rs" => 10,
|
|
170
174
|
"bridge/wrapper.rs" => 3,
|
|
171
175
|
}.freeze
|
|
172
176
|
|
|
@@ -718,6 +722,10 @@ def unwrapped_entries(rust)
|
|
|
718
722
|
code.to_enum(:scan, REGISTRATION).each do
|
|
719
723
|
m = Regexp.last_match
|
|
720
724
|
fpath = first_argument(code, m.end(0) - 1)
|
|
725
|
+
# A generic function registered per representation
|
|
726
|
+
# (`child_count::<HtmlSelf>`) is one definition: resolve it without its
|
|
727
|
+
# type arguments.
|
|
728
|
+
fpath = fpath&.sub(/::<[\w:, ]+>\z/, "")
|
|
721
729
|
unless fpath&.match?(/\A[\w:]+\z/)
|
|
722
730
|
missing << "#{rel}: registration of `#{fpath}` is not a function path"
|
|
723
731
|
next
|