makiri 0.16.0 → 0.17.0.rc2

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.
Files changed (793) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +206 -0
  3. data/NOKOGIRI_DIFFERENCES.md +95 -53
  4. data/NOTICE +51 -0
  5. data/README.md +36 -19
  6. data/ext/makiri/rust/Cargo.lock +22 -0
  7. data/ext/makiri/rust/Cargo.toml +43 -8
  8. data/ext/makiri/rust/build.rs +39 -7
  9. data/ext/makiri/rust/extconf.rb +17 -193
  10. data/ext/makiri/rust/src/bridge/alloc.rs +123 -8
  11. data/ext/makiri/rust/src/bridge/build.rs +61 -0
  12. data/ext/makiri/rust/src/bridge/doc.rs +91 -81
  13. data/ext/makiri/rust/src/bridge/dom.rs +157 -0
  14. data/ext/makiri/rust/src/bridge/fragment.rs +139 -128
  15. data/ext/makiri/rust/src/bridge/gvl.rs +5 -26
  16. data/ext/makiri/rust/src/bridge/html.rs +457 -348
  17. data/ext/makiri/rust/src/bridge/mod.rs +19 -10
  18. data/ext/makiri/rust/src/bridge/node_set.rs +238 -157
  19. data/ext/makiri/rust/src/bridge/raw.rs +504 -0
  20. data/ext/makiri/rust/src/bridge/ruby.rs +119 -200
  21. data/ext/makiri/rust/src/bridge/string/build.rs +120 -0
  22. data/ext/makiri/rust/src/bridge/string/encoding.rs +246 -0
  23. data/ext/makiri/rust/src/bridge/string/mod.rs +35 -0
  24. data/ext/makiri/rust/src/bridge/string/source.rs +150 -0
  25. data/ext/makiri/rust/src/bridge/string/view.rs +395 -0
  26. data/ext/makiri/rust/src/bridge/typed.rs +363 -96
  27. data/ext/makiri/rust/src/bridge/wrapper/accounting.rs +90 -0
  28. data/ext/makiri/rust/src/bridge/wrapper/document.rs +678 -0
  29. data/ext/makiri/rust/src/bridge/wrapper/edit.rs +131 -0
  30. data/ext/makiri/rust/src/bridge/wrapper/mod.rs +18 -0
  31. data/ext/makiri/rust/src/bridge/wrapper/node.rs +325 -0
  32. data/ext/makiri/rust/src/bridge/xml.rs +229 -159
  33. data/ext/makiri/rust/src/bridge/xml_decode.rs +76 -72
  34. data/ext/makiri/rust/src/bridge/xpath/context_object.rs +111 -133
  35. data/ext/makiri/rust/src/bridge/xpath/mod.rs +76 -190
  36. data/ext/makiri/rust/src/cbuf/verify.rs +37 -247
  37. data/ext/makiri/rust/src/cbuf.rs +231 -238
  38. data/ext/makiri/rust/src/child_index/tests.rs +1 -0
  39. data/ext/makiri/rust/src/child_index.rs +13 -3
  40. data/ext/makiri/rust/src/compat.rs +458 -0
  41. data/ext/makiri/rust/src/conformance/dat.rs +150 -0
  42. data/ext/makiri/rust/src/conformance/json.rs +278 -0
  43. data/ext/makiri/rust/src/conformance/known.rs +67 -0
  44. data/ext/makiri/rust/src/conformance/mod.rs +55 -0
  45. data/ext/makiri/rust/src/conformance/res_gen.rs +609 -0
  46. data/ext/makiri/rust/src/conformance/tokens.rs +355 -0
  47. data/ext/makiri/rust/src/conformance/tree.rs +340 -0
  48. data/ext/makiri/rust/src/css/build.rs +12 -9
  49. data/ext/makiri/rust/src/css/lower.rs +87 -97
  50. data/ext/makiri/rust/src/css/mod.rs +28 -43
  51. data/ext/makiri/rust/src/css_cache.rs +399 -0
  52. data/ext/makiri/rust/src/{lexbor/css_match → css_match}/compile.rs +171 -23
  53. data/ext/makiri/rust/src/css_match/dom.rs +145 -0
  54. data/ext/makiri/rust/src/{lexbor/css_match → css_match}/mod.rs +197 -99
  55. data/ext/makiri/rust/src/css_match/ns.rs +147 -0
  56. data/ext/makiri/rust/src/css_match/nth_of.rs +168 -0
  57. data/ext/makiri/rust/src/css_match/plan.rs +97 -0
  58. data/ext/makiri/rust/src/{lexbor/css_match → css_match}/positions.rs +54 -95
  59. data/ext/makiri/rust/src/{lexbor/css_match → css_match}/query.rs +112 -154
  60. data/ext/makiri/rust/src/{lexbor/css_match → css_match}/scratch.rs +38 -18
  61. data/ext/makiri/rust/src/{lexbor/css_match → css_match}/simple.rs +104 -54
  62. data/ext/makiri/rust/src/{lexbor/css_match → css_match}/state.rs +157 -49
  63. data/ext/makiri/rust/src/{lexbor/css_match → css_match}/tree.rs +29 -24
  64. data/ext/makiri/rust/src/doc_cell.rs +177 -0
  65. data/ext/makiri/rust/src/dom_rules/tests.rs +1 -0
  66. data/ext/makiri/rust/src/dom_rules.rs +46 -0
  67. data/ext/makiri/rust/src/falloc/inject.rs +72 -20
  68. data/ext/makiri/rust/src/falloc/mod.rs +232 -52
  69. data/ext/makiri/rust/src/glue/css.rs +120 -4
  70. data/ext/makiri/rust/src/glue/hash.rs +6 -8
  71. data/ext/makiri/rust/src/glue/html_doc.rs +78 -28
  72. data/ext/makiri/rust/src/glue/html_node/css.rs +57 -118
  73. data/ext/makiri/rust/src/glue/html_node/mod.rs +1 -0
  74. data/ext/makiri/rust/src/glue/html_node/mutate.rs +181 -142
  75. data/ext/makiri/rust/src/glue/html_node/read.rs +224 -198
  76. data/ext/makiri/rust/src/glue/html_node/serialize.rs +39 -21
  77. data/ext/makiri/rust/src/glue/kwargs.rs +21 -13
  78. data/ext/makiri/rust/src/glue/mod.rs +7 -6
  79. data/ext/makiri/rust/src/glue/node.rs +56 -16
  80. data/ext/makiri/rust/src/glue/node_set.rs +21 -12
  81. data/ext/makiri/rust/src/glue/query.rs +57 -53
  82. data/ext/makiri/rust/src/glue/stylesheet.rs +90 -82
  83. data/ext/makiri/rust/src/glue/xml_doc.rs +8 -17
  84. data/ext/makiri/rust/src/glue/xml_node/css.rs +71 -79
  85. data/ext/makiri/rust/src/glue/xml_node/mod.rs +3 -1
  86. data/ext/makiri/rust/src/glue/xml_node/mutate.rs +52 -43
  87. data/ext/makiri/rust/src/glue/xml_node/ns.rs +51 -30
  88. data/ext/makiri/rust/src/glue/xml_node/read.rs +136 -121
  89. data/ext/makiri/rust/src/glue/xml_node/serialize.rs +17 -16
  90. data/ext/makiri/rust/src/glue/xpath_context.rs +15 -20
  91. data/ext/makiri/rust/src/gvl.rs +76 -59
  92. data/ext/makiri/rust/src/html/dom/build.rs +64 -0
  93. data/ext/makiri/rust/src/html/dom/compact.rs +79 -0
  94. data/ext/makiri/rust/src/html/dom/conformance.rs +116 -0
  95. data/ext/makiri/rust/src/html/dom/copy.rs +252 -0
  96. data/ext/makiri/rust/src/{lexbor/adapter → html/dom}/cross_import.rs +86 -110
  97. data/ext/makiri/rust/src/html/dom/css.rs +185 -0
  98. data/ext/makiri/rust/src/html/dom/edit.rs +726 -0
  99. data/ext/makiri/rust/src/html/dom/ext_table.rs +85 -0
  100. data/ext/makiri/rust/src/html/dom/handle.rs +982 -0
  101. data/ext/makiri/rust/src/html/dom/index.rs +292 -0
  102. data/ext/makiri/rust/src/html/dom/mod.rs +1274 -0
  103. data/ext/makiri/rust/src/html/dom/parsed.rs +277 -0
  104. data/ext/makiri/rust/src/html/dom/serialize.rs +521 -0
  105. data/ext/makiri/rust/src/html/dom/store.rs +234 -0
  106. data/ext/makiri/rust/src/html/dom/tests.rs +150 -0
  107. data/ext/makiri/rust/src/{lexbor → html/dom}/xpath.rs +67 -115
  108. data/ext/makiri/rust/src/html/encoding/mod.rs +522 -0
  109. data/ext/makiri/rust/src/html/encoding/prescan.rs +249 -0
  110. data/ext/makiri/rust/src/html/fragment.rs +266 -0
  111. data/ext/makiri/rust/src/html/mod.rs +18 -0
  112. data/ext/makiri/rust/src/html/names.rs +555 -0
  113. data/ext/makiri/rust/src/html/res/entities.rs +12101 -0
  114. data/ext/makiri/rust/src/html/res/mod.rs +78 -0
  115. data/ext/makiri/rust/src/html/res/names.rs +802 -0
  116. data/ext/makiri/rust/src/html/res/tree.rs +504 -0
  117. data/ext/makiri/rust/src/html/tokenizer/error.rs +113 -0
  118. data/ext/makiri/rust/src/html/tokenizer/mod.rs +898 -0
  119. data/ext/makiri/rust/src/html/tokenizer/state.rs +1281 -0
  120. data/ext/makiri/rust/src/html/tokenizer/state_comment.rs +216 -0
  121. data/ext/makiri/rust/src/html/tokenizer/state_doctype.rs +568 -0
  122. data/ext/makiri/rust/src/html/tokenizer/state_text.rs +611 -0
  123. data/ext/makiri/rust/src/html/tokenizer/tests.rs +232 -0
  124. data/ext/makiri/rust/src/html/tree/actions.rs +1093 -0
  125. data/ext/makiri/rust/src/html/tree/document_bytes.rs +95 -0
  126. data/ext/makiri/rust/src/html/tree/error.rs +102 -0
  127. data/ext/makiri/rust/src/html/tree/fragment.rs +194 -0
  128. data/ext/makiri/rust/src/html/tree/guard.rs +91 -0
  129. data/ext/makiri/rust/src/html/tree/mod.rs +701 -0
  130. data/ext/makiri/rust/src/html/tree/modes/after_after_body.rs +43 -0
  131. data/ext/makiri/rust/src/html/tree/modes/after_after_frameset.rs +56 -0
  132. data/ext/makiri/rust/src/html/tree/modes/after_body.rs +47 -0
  133. data/ext/makiri/rust/src/html/tree/modes/after_frameset.rs +42 -0
  134. data/ext/makiri/rust/src/html/tree/modes/after_head.rs +107 -0
  135. data/ext/makiri/rust/src/html/tree/modes/before_head.rs +70 -0
  136. data/ext/makiri/rust/src/html/tree/modes/before_html.rs +85 -0
  137. data/ext/makiri/rust/src/html/tree/modes/foreign_content.rs +260 -0
  138. data/ext/makiri/rust/src/html/tree/modes/in_body.rs +1028 -0
  139. data/ext/makiri/rust/src/html/tree/modes/in_caption.rs +59 -0
  140. data/ext/makiri/rust/src/html/tree/modes/in_cell.rs +77 -0
  141. data/ext/makiri/rust/src/html/tree/modes/in_column_group.rs +94 -0
  142. data/ext/makiri/rust/src/html/tree/modes/in_frameset.rs +89 -0
  143. data/ext/makiri/rust/src/html/tree/modes/in_head.rs +142 -0
  144. data/ext/makiri/rust/src/html/tree/modes/in_head_noscript.rs +67 -0
  145. data/ext/makiri/rust/src/html/tree/modes/in_row.rs +87 -0
  146. data/ext/makiri/rust/src/html/tree/modes/in_table.rs +234 -0
  147. data/ext/makiri/rust/src/html/tree/modes/in_table_body.rs +104 -0
  148. data/ext/makiri/rust/src/html/tree/modes/in_table_text.rs +80 -0
  149. data/ext/makiri/rust/src/html/tree/modes/in_template.rs +66 -0
  150. data/ext/makiri/rust/src/html/tree/modes/initial.rs +185 -0
  151. data/ext/makiri/rust/src/html/tree/modes/mod.rs +25 -0
  152. data/ext/makiri/rust/src/html/tree/modes/text.rs +27 -0
  153. data/ext/makiri/rust/src/html/tree/parse.rs +209 -0
  154. data/ext/makiri/rust/src/html/tree/select.rs +701 -0
  155. data/ext/makiri/rust/src/html/tree/stacks.rs +463 -0
  156. data/ext/makiri/rust/src/html/tree/stamp.rs +113 -0
  157. data/ext/makiri/rust/src/html/tree/wpt_tests.rs +88 -0
  158. data/ext/makiri/rust/src/html_dom.rs +39 -0
  159. data/ext/makiri/rust/src/init.rs +67 -19
  160. data/ext/makiri/rust/src/lexbor/abi.rs +0 -12
  161. data/ext/makiri/rust/src/lexbor/adapter/arena_copy.rs +171 -0
  162. data/ext/makiri/rust/src/lexbor/adapter/html/attrs.rs +0 -62
  163. data/ext/makiri/rust/src/lexbor/adapter/html/build.rs +6 -322
  164. data/ext/makiri/rust/src/lexbor/adapter/html/mod.rs +29 -118
  165. data/ext/makiri/rust/src/lexbor/adapter/mod.rs +2 -3
  166. data/ext/makiri/rust/src/lexbor/adapter/post_parse.rs +15 -214
  167. data/ext/makiri/rust/src/lexbor/adapter/source_loc.rs +2 -77
  168. data/ext/makiri/rust/src/lexbor/adapter/tree_guard.rs +17 -187
  169. data/ext/makiri/rust/src/lexbor/chunks.rs +2 -2
  170. data/ext/makiri/rust/src/lexbor/conformance_tests.rs +1196 -0
  171. data/ext/makiri/rust/src/lexbor/css_engine.rs +19 -25
  172. data/ext/makiri/rust/src/lexbor/css_parser.rs +36 -24
  173. data/ext/makiri/rust/src/lexbor/fragment.rs +64 -113
  174. data/ext/makiri/rust/src/lexbor/mod.rs +65 -25
  175. data/ext/makiri/rust/src/lexbor/res_tests.rs +452 -0
  176. data/ext/makiri/rust/src/lexbor/selector_diff.rs +157 -0
  177. data/ext/makiri/rust/src/lexbor/selector_port_tests.rs +1123 -0
  178. data/ext/makiri/rust/src/lexbor/selectors.rs +11 -4
  179. data/ext/makiri/rust/src/lexbor/serialize.rs +2 -4
  180. data/ext/makiri/rust/src/lexbor/stylesheet_diff.rs +340 -0
  181. data/ext/makiri/rust/src/lexbor/tests.rs +264 -486
  182. data/ext/makiri/rust/src/lexbor/tree_diff.rs +477 -0
  183. data/ext/makiri/rust/src/lexbor/tree_port_tests.rs +838 -0
  184. data/ext/makiri/rust/src/lexbor/twin.rs +71 -0
  185. data/ext/makiri/rust/src/lib.rs +54 -4
  186. data/ext/makiri/rust/src/lint_probe.rs +82 -0
  187. data/ext/makiri/rust/src/ptr_table.rs +28 -5
  188. data/ext/makiri/rust/src/rust_tests.rs +2 -2
  189. data/ext/makiri/rust/src/selectors/ast.rs +473 -0
  190. data/ext/makiri/rust/src/selectors/mod.rs +35 -0
  191. data/ext/makiri/rust/src/selectors/parser/syntax.rs +1101 -0
  192. data/ext/makiri/rust/src/selectors/parser.rs +2454 -0
  193. data/ext/makiri/rust/src/selectors/pseudo.rs +404 -0
  194. data/ext/makiri/rust/src/selectors/rules.rs +123 -0
  195. data/ext/makiri/rust/src/selectors/specificity.rs +88 -0
  196. data/ext/makiri/rust/src/selectors/strtod.rs +351 -0
  197. data/ext/makiri/rust/src/selectors/stylesheet.rs +379 -0
  198. data/ext/makiri/rust/src/{lexbor/selector_text.rs → selectors/text.rs} +102 -5
  199. data/ext/makiri/rust/src/selectors/token.rs +72 -0
  200. data/ext/makiri/rust/src/selectors/tokenizer.rs +1453 -0
  201. data/ext/makiri/rust/src/source_lines.rs +134 -0
  202. data/ext/makiri/rust/src/token.rs +23 -32
  203. data/ext/makiri/rust/src/utf8_input.rs +1 -1
  204. data/ext/makiri/rust/src/xml/arena.rs +9 -6
  205. data/ext/makiri/rust/src/xml/attr_key.rs +2 -2
  206. data/ext/makiri/rust/src/xml/chars/mod.rs +6 -4
  207. data/ext/makiri/rust/src/xml/css.rs +314 -0
  208. data/ext/makiri/rust/src/xml/css_tests.rs +441 -0
  209. data/ext/makiri/rust/src/xml/encoding_names.rs +221 -0
  210. data/ext/makiri/rust/src/xml/index.rs +60 -5
  211. data/ext/makiri/rust/src/xml/mod.rs +4 -0
  212. data/ext/makiri/rust/src/xml/model.rs +2 -0
  213. data/ext/makiri/rust/src/xml/mutate/copy.rs +1 -1
  214. data/ext/makiri/rust/src/xml/mutate/edit.rs +10 -7
  215. data/ext/makiri/rust/src/xml/mutate/insert.rs +3 -3
  216. data/ext/makiri/rust/src/xml/mutate/ns.rs +1 -1
  217. data/ext/makiri/rust/src/xml/selftest.rs +1 -1
  218. data/ext/makiri/rust/src/xml/serialize/bindings.rs +10 -9
  219. data/ext/makiri/rust/src/xml/serialize/c14n.rs +1 -1
  220. data/ext/makiri/rust/src/xml/serialize/out.rs +1 -0
  221. data/ext/makiri/rust/src/xml/tree/dtd.rs +1 -1
  222. data/ext/makiri/rust/src/xml/tree/mod.rs +6 -5
  223. data/ext/makiri/rust/src/xml/tree/scope.rs +2 -3
  224. data/ext/makiri/rust/src/xml/xpath.rs +6 -0
  225. data/ext/makiri/rust/src/xpath/abi.rs +2 -1
  226. data/ext/makiri/rust/src/xpath/ast.rs +1 -2
  227. data/ext/makiri/rust/src/xpath/ast_ops.rs +2 -2
  228. data/ext/makiri/rust/src/xpath/ctx.rs +28 -85
  229. data/ext/makiri/rust/src/xpath/dom.rs +35 -5
  230. data/ext/makiri/rust/src/xpath/eval.rs +44 -94
  231. data/ext/makiri/rust/src/xpath/funcs/css_hooks.rs +210 -0
  232. data/ext/makiri/rust/src/xpath/funcs/ext.rs +2 -204
  233. data/ext/makiri/rust/src/xpath/funcs/mod.rs +192 -78
  234. data/ext/makiri/rust/src/xpath/order.rs +262 -4
  235. data/ext/makiri/rust/src/xpath/parse.rs +12 -1
  236. data/ext/makiri/rust/src/xpath/step_index.rs +4 -2
  237. data/ext/makiri/rust/src/xpath/str_cache.rs +6 -6
  238. data/ext/makiri/rust/src/xpath/tests.rs +54 -85
  239. data/ext/makiri/rust/src/xpath/value.rs +4 -8
  240. data/lib/makiri/css.rb +3 -2
  241. data/lib/makiri/html/document.rb +21 -11
  242. data/lib/makiri/node.rb +18 -10
  243. data/lib/makiri/node_set.rb +1 -1
  244. data/lib/makiri/version.rb +1 -1
  245. data/lib/makiri/xml/builder.rb +9 -7
  246. data/lib/makiri/xml/document.rb +12 -0
  247. data/lib/makiri/xml/node_methods.rb +16 -51
  248. data/lib/makiri/xpath_context.rb +6 -12
  249. data/lib/makiri.rb +3 -3
  250. metadata +136 -560
  251. data/.github/workflows/ci.yml +0 -204
  252. data/.github/workflows/conformance.yml +0 -135
  253. data/.github/workflows/css-match.yml +0 -217
  254. data/.github/workflows/libfuzzer.yml +0 -116
  255. data/.github/workflows/release.yml +0 -273
  256. data/.github/workflows/security.yml +0 -305
  257. data/.github/workflows/valgrind.yml +0 -187
  258. data/.github/workflows/verify.yml +0 -71
  259. data/.gitmodules +0 -3
  260. data/Rakefile +0 -946
  261. data/ext/makiri/rust/clippy.toml +0 -67
  262. data/ext/makiri/rust/fuzz/Cargo.lock +0 -303
  263. data/ext/makiri/rust/fuzz/Cargo.toml +0 -79
  264. data/ext/makiri/rust/fuzz/build.rs +0 -7
  265. data/ext/makiri/rust/fuzz/css.dict +0 -77
  266. data/ext/makiri/rust/fuzz/fuzz_targets/common.rs +0 -80
  267. data/ext/makiri/rust/fuzz/fuzz_targets/css.rs +0 -79
  268. data/ext/makiri/rust/fuzz/fuzz_targets/html.rs +0 -24
  269. data/ext/makiri/rust/fuzz/fuzz_targets/html_css.rs +0 -104
  270. data/ext/makiri/rust/fuzz/fuzz_targets/html_css_diff.rs +0 -300
  271. data/ext/makiri/rust/fuzz/fuzz_targets/html_xpath.rs +0 -80
  272. data/ext/makiri/rust/fuzz/fuzz_targets/xml.rs +0 -17
  273. data/ext/makiri/rust/fuzz/fuzz_targets/xml_xpath.rs +0 -64
  274. data/ext/makiri/rust/fuzz/fuzz_targets/xpath.rs +0 -58
  275. data/ext/makiri/rust/src/bridge/string.rs +0 -820
  276. data/ext/makiri/rust/src/bridge/wrapper.rs +0 -1142
  277. data/ext/makiri/rust/src/bridge/xpath/handler.rs +0 -343
  278. data/ext/makiri/rust/src/falloc/cstr/verify.rs +0 -40
  279. data/ext/makiri/rust/src/falloc/cstr.rs +0 -44
  280. data/ext/makiri/rust/src/glue/xml_node/strings.rs +0 -25
  281. data/ext/makiri/rust/src/lexbor/adapter/dom_index.rs +0 -162
  282. data/ext/makiri/rust/src/lexbor/adapter/html/mutate.rs +0 -368
  283. data/ext/makiri/rust/src/lexbor/adapter/text_index.rs +0 -291
  284. data/ext/makiri/rust/src/lexbor/memory.rs +0 -78
  285. data/ext/makiri/rust/src/lexbor/selector_cache.rs +0 -356
  286. data/ext/makiri/rust/src/lexbor/stylesheet.rs +0 -481
  287. data/ext/makiri/rust/tests/alloc_inject_map_insert.rs +0 -47
  288. data/lib/makiri/error.rb +0 -26
  289. data/script/api_manifest.rb +0 -173
  290. data/script/build_native_gem.rb +0 -53
  291. data/script/check_alloc_failures.rb +0 -815
  292. data/script/check_leaks.rb +0 -64
  293. data/script/check_unsafe_boundaries.rb +0 -782
  294. data/script/leaks_harness.rb +0 -90
  295. data/suppressions/ruby.supp +0 -194
  296. data/tools/pe_exports.rb +0 -124
  297. data/vendor/lexbor/.travis.yml +0 -50
  298. data/vendor/lexbor/CHANGELOG.md +0 -285
  299. data/vendor/lexbor/CMakeLists.txt +0 -481
  300. data/vendor/lexbor/INSTALL.md +0 -74
  301. data/vendor/lexbor/README.md +0 -292
  302. data/vendor/lexbor/SECURITY.md +0 -18
  303. data/vendor/lexbor/config.cmake +0 -983
  304. data/vendor/lexbor/feature.cmake +0 -204
  305. data/vendor/lexbor/lexbor-config.cmake.in +0 -8
  306. data/vendor/lexbor/lexbor.pc.in +0 -12
  307. data/vendor/lexbor/pvs_studio.sh +0 -18
  308. data/vendor/lexbor/single.pl +0 -2490
  309. data/vendor/lexbor/source/lexbor/core/array.c +0 -208
  310. data/vendor/lexbor/source/lexbor/core/array.h +0 -100
  311. data/vendor/lexbor/source/lexbor/core/array_obj.c +0 -216
  312. data/vendor/lexbor/source/lexbor/core/array_obj.h +0 -134
  313. data/vendor/lexbor/source/lexbor/core/avl.c +0 -525
  314. data/vendor/lexbor/source/lexbor/core/avl.h +0 -92
  315. data/vendor/lexbor/source/lexbor/core/base.h +0 -108
  316. data/vendor/lexbor/source/lexbor/core/bst.c +0 -471
  317. data/vendor/lexbor/source/lexbor/core/bst.h +0 -108
  318. data/vendor/lexbor/source/lexbor/core/bst_map.c +0 -238
  319. data/vendor/lexbor/source/lexbor/core/bst_map.h +0 -87
  320. data/vendor/lexbor/source/lexbor/core/config.cmake +0 -20
  321. data/vendor/lexbor/source/lexbor/core/conv.c +0 -356
  322. data/vendor/lexbor/source/lexbor/core/conv.h +0 -62
  323. data/vendor/lexbor/source/lexbor/core/core.h +0 -35
  324. data/vendor/lexbor/source/lexbor/core/def.h +0 -59
  325. data/vendor/lexbor/source/lexbor/core/diyfp.c +0 -181
  326. data/vendor/lexbor/source/lexbor/core/diyfp.h +0 -285
  327. data/vendor/lexbor/source/lexbor/core/dobject.c +0 -187
  328. data/vendor/lexbor/source/lexbor/core/dobject.h +0 -88
  329. data/vendor/lexbor/source/lexbor/core/dtoa.c +0 -401
  330. data/vendor/lexbor/source/lexbor/core/dtoa.h +0 -54
  331. data/vendor/lexbor/source/lexbor/core/fs.h +0 -60
  332. data/vendor/lexbor/source/lexbor/core/hash.c +0 -477
  333. data/vendor/lexbor/source/lexbor/core/hash.h +0 -218
  334. data/vendor/lexbor/source/lexbor/core/in.c +0 -266
  335. data/vendor/lexbor/source/lexbor/core/in.h +0 -172
  336. data/vendor/lexbor/source/lexbor/core/lexbor.h +0 -43
  337. data/vendor/lexbor/source/lexbor/core/mem.c +0 -228
  338. data/vendor/lexbor/source/lexbor/core/mem.h +0 -141
  339. data/vendor/lexbor/source/lexbor/core/mraw.c +0 -421
  340. data/vendor/lexbor/source/lexbor/core/mraw.h +0 -114
  341. data/vendor/lexbor/source/lexbor/core/perf.h +0 -40
  342. data/vendor/lexbor/source/lexbor/core/plog.c +0 -73
  343. data/vendor/lexbor/source/lexbor/core/plog.h +0 -102
  344. data/vendor/lexbor/source/lexbor/core/print.c +0 -168
  345. data/vendor/lexbor/source/lexbor/core/print.h +0 -39
  346. data/vendor/lexbor/source/lexbor/core/sbst.h +0 -59
  347. data/vendor/lexbor/source/lexbor/core/serialize.c +0 -27
  348. data/vendor/lexbor/source/lexbor/core/serialize.h +0 -32
  349. data/vendor/lexbor/source/lexbor/core/shs.c +0 -118
  350. data/vendor/lexbor/source/lexbor/core/shs.h +0 -82
  351. data/vendor/lexbor/source/lexbor/core/str.c +0 -667
  352. data/vendor/lexbor/source/lexbor/core/str.h +0 -257
  353. data/vendor/lexbor/source/lexbor/core/str_res.h +0 -360
  354. data/vendor/lexbor/source/lexbor/core/strtod.c +0 -348
  355. data/vendor/lexbor/source/lexbor/core/strtod.h +0 -54
  356. data/vendor/lexbor/source/lexbor/core/swar.h +0 -97
  357. data/vendor/lexbor/source/lexbor/core/types.h +0 -39
  358. data/vendor/lexbor/source/lexbor/core/utils.c +0 -43
  359. data/vendor/lexbor/source/lexbor/core/utils.h +0 -36
  360. data/vendor/lexbor/source/lexbor/css/at_rule/const.h +0 -32
  361. data/vendor/lexbor/source/lexbor/css/at_rule/res.h +0 -49
  362. data/vendor/lexbor/source/lexbor/css/at_rule/state.c +0 -374
  363. data/vendor/lexbor/source/lexbor/css/at_rule/state.h +0 -128
  364. data/vendor/lexbor/source/lexbor/css/at_rule/types.h +0 -60
  365. data/vendor/lexbor/source/lexbor/css/at_rule.c +0 -449
  366. data/vendor/lexbor/source/lexbor/css/at_rule.h +0 -152
  367. data/vendor/lexbor/source/lexbor/css/base.h +0 -136
  368. data/vendor/lexbor/source/lexbor/css/blank.c +0 -389
  369. data/vendor/lexbor/source/lexbor/css/blank.h +0 -38
  370. data/vendor/lexbor/source/lexbor/css/config.cmake +0 -2
  371. data/vendor/lexbor/source/lexbor/css/css.c +0 -254
  372. data/vendor/lexbor/source/lexbor/css/css.h +0 -52
  373. data/vendor/lexbor/source/lexbor/css/declaration.c +0 -86
  374. data/vendor/lexbor/source/lexbor/css/declaration.h +0 -33
  375. data/vendor/lexbor/source/lexbor/css/log.c +0 -335
  376. data/vendor/lexbor/source/lexbor/css/log.h +0 -103
  377. data/vendor/lexbor/source/lexbor/css/parser.c +0 -563
  378. data/vendor/lexbor/source/lexbor/css/parser.h +0 -756
  379. data/vendor/lexbor/source/lexbor/css/property/const.h +0 -1180
  380. data/vendor/lexbor/source/lexbor/css/property/res.h +0 -524
  381. data/vendor/lexbor/source/lexbor/css/property/state.c +0 -5343
  382. data/vendor/lexbor/source/lexbor/css/property/state.h +0 -330
  383. data/vendor/lexbor/source/lexbor/css/property/types.h +0 -21
  384. data/vendor/lexbor/source/lexbor/css/property.c +0 -3171
  385. data/vendor/lexbor/source/lexbor/css/property.h +0 -1754
  386. data/vendor/lexbor/source/lexbor/css/rule.c +0 -598
  387. data/vendor/lexbor/source/lexbor/css/rule.h +0 -453
  388. data/vendor/lexbor/source/lexbor/css/selectors/base.h +0 -47
  389. data/vendor/lexbor/source/lexbor/css/selectors/pseudo.c +0 -102
  390. data/vendor/lexbor/source/lexbor/css/selectors/pseudo.h +0 -70
  391. data/vendor/lexbor/source/lexbor/css/selectors/pseudo_const.h +0 -110
  392. data/vendor/lexbor/source/lexbor/css/selectors/pseudo_res.h +0 -325
  393. data/vendor/lexbor/source/lexbor/css/selectors/pseudo_state.c +0 -429
  394. data/vendor/lexbor/source/lexbor/css/selectors/pseudo_state.h +0 -89
  395. data/vendor/lexbor/source/lexbor/css/selectors/selector.c +0 -1002
  396. data/vendor/lexbor/source/lexbor/css/selectors/selector.h +0 -283
  397. data/vendor/lexbor/source/lexbor/css/selectors/selectors.c +0 -326
  398. data/vendor/lexbor/source/lexbor/css/selectors/selectors.h +0 -123
  399. data/vendor/lexbor/source/lexbor/css/selectors/state.c +0 -2085
  400. data/vendor/lexbor/source/lexbor/css/selectors/state.h +0 -86
  401. data/vendor/lexbor/source/lexbor/css/state.c +0 -676
  402. data/vendor/lexbor/source/lexbor/css/state.h +0 -59
  403. data/vendor/lexbor/source/lexbor/css/stylesheet.c +0 -111
  404. data/vendor/lexbor/source/lexbor/css/stylesheet.h +0 -90
  405. data/vendor/lexbor/source/lexbor/css/syntax/anb.c +0 -486
  406. data/vendor/lexbor/source/lexbor/css/syntax/anb.h +0 -46
  407. data/vendor/lexbor/source/lexbor/css/syntax/base.h +0 -33
  408. data/vendor/lexbor/source/lexbor/css/syntax/parser.c +0 -2251
  409. data/vendor/lexbor/source/lexbor/css/syntax/parser.h +0 -95
  410. data/vendor/lexbor/source/lexbor/css/syntax/res.h +0 -42
  411. data/vendor/lexbor/source/lexbor/css/syntax/state.c +0 -1852
  412. data/vendor/lexbor/source/lexbor/css/syntax/state.h +0 -128
  413. data/vendor/lexbor/source/lexbor/css/syntax/state_res.h +0 -273
  414. data/vendor/lexbor/source/lexbor/css/syntax/syntax.c +0 -535
  415. data/vendor/lexbor/source/lexbor/css/syntax/syntax.h +0 -255
  416. data/vendor/lexbor/source/lexbor/css/syntax/token.c +0 -674
  417. data/vendor/lexbor/source/lexbor/css/syntax/token.h +0 -333
  418. data/vendor/lexbor/source/lexbor/css/syntax/token_res.h +0 -82
  419. data/vendor/lexbor/source/lexbor/css/syntax/tokenizer/error.c +0 -30
  420. data/vendor/lexbor/source/lexbor/css/syntax/tokenizer/error.h +0 -60
  421. data/vendor/lexbor/source/lexbor/css/syntax/tokenizer.c +0 -397
  422. data/vendor/lexbor/source/lexbor/css/syntax/tokenizer.h +0 -123
  423. data/vendor/lexbor/source/lexbor/css/unit/const.h +0 -98
  424. data/vendor/lexbor/source/lexbor/css/unit/res.h +0 -294
  425. data/vendor/lexbor/source/lexbor/css/unit.c +0 -113
  426. data/vendor/lexbor/source/lexbor/css/unit.h +0 -46
  427. data/vendor/lexbor/source/lexbor/css/value/const.h +0 -397
  428. data/vendor/lexbor/source/lexbor/css/value/res.h +0 -775
  429. data/vendor/lexbor/source/lexbor/css/value.c +0 -678
  430. data/vendor/lexbor/source/lexbor/css/value.h +0 -290
  431. data/vendor/lexbor/source/lexbor/dom/base.h +0 -32
  432. data/vendor/lexbor/source/lexbor/dom/collection.c +0 -97
  433. data/vendor/lexbor/source/lexbor/dom/collection.h +0 -112
  434. data/vendor/lexbor/source/lexbor/dom/config.cmake +0 -3
  435. data/vendor/lexbor/source/lexbor/dom/dom.h +0 -29
  436. data/vendor/lexbor/source/lexbor/dom/exception.c +0 -372
  437. data/vendor/lexbor/source/lexbor/dom/exception.h +0 -99
  438. data/vendor/lexbor/source/lexbor/dom/interface.c +0 -110
  439. data/vendor/lexbor/source/lexbor/dom/interface.h +0 -86
  440. data/vendor/lexbor/source/lexbor/dom/interfaces/attr.c +0 -534
  441. data/vendor/lexbor/source/lexbor/dom/interfaces/attr.h +0 -141
  442. data/vendor/lexbor/source/lexbor/dom/interfaces/attr_const.h +0 -99
  443. data/vendor/lexbor/source/lexbor/dom/interfaces/attr_res.h +0 -263
  444. data/vendor/lexbor/source/lexbor/dom/interfaces/cdata_section.c +0 -55
  445. data/vendor/lexbor/source/lexbor/dom/interfaces/cdata_section.h +0 -38
  446. data/vendor/lexbor/source/lexbor/dom/interfaces/character_data.c +0 -116
  447. data/vendor/lexbor/source/lexbor/dom/interfaces/character_data.h +0 -51
  448. data/vendor/lexbor/source/lexbor/dom/interfaces/comment.c +0 -64
  449. data/vendor/lexbor/source/lexbor/dom/interfaces/comment.h +0 -42
  450. data/vendor/lexbor/source/lexbor/dom/interfaces/document.c +0 -593
  451. data/vendor/lexbor/source/lexbor/dom/interfaces/document.h +0 -336
  452. data/vendor/lexbor/source/lexbor/dom/interfaces/document_fragment.c +0 -36
  453. data/vendor/lexbor/source/lexbor/dom/interfaces/document_fragment.h +0 -36
  454. data/vendor/lexbor/source/lexbor/dom/interfaces/document_type.c +0 -232
  455. data/vendor/lexbor/source/lexbor/dom/interfaces/document_type.h +0 -135
  456. data/vendor/lexbor/source/lexbor/dom/interfaces/element.c +0 -896
  457. data/vendor/lexbor/source/lexbor/dom/interfaces/element.h +0 -361
  458. data/vendor/lexbor/source/lexbor/dom/interfaces/event_target.c +0 -32
  459. data/vendor/lexbor/source/lexbor/dom/interfaces/event_target.h +0 -34
  460. data/vendor/lexbor/source/lexbor/dom/interfaces/node.c +0 -1866
  461. data/vendor/lexbor/source/lexbor/dom/interfaces/node.h +0 -396
  462. data/vendor/lexbor/source/lexbor/dom/interfaces/processing_instruction.c +0 -92
  463. data/vendor/lexbor/source/lexbor/dom/interfaces/processing_instruction.h +0 -66
  464. data/vendor/lexbor/source/lexbor/dom/interfaces/shadow_root.c +0 -36
  465. data/vendor/lexbor/source/lexbor/dom/interfaces/shadow_root.h +0 -44
  466. data/vendor/lexbor/source/lexbor/dom/interfaces/text.c +0 -63
  467. data/vendor/lexbor/source/lexbor/dom/interfaces/text.h +0 -42
  468. data/vendor/lexbor/source/lexbor/encoding/base.h +0 -218
  469. data/vendor/lexbor/source/lexbor/encoding/config.cmake +0 -12
  470. data/vendor/lexbor/source/lexbor/encoding/const.h +0 -65
  471. data/vendor/lexbor/source/lexbor/encoding/decode.c +0 -3383
  472. data/vendor/lexbor/source/lexbor/encoding/decode.h +0 -381
  473. data/vendor/lexbor/source/lexbor/encoding/encode.c +0 -2054
  474. data/vendor/lexbor/source/lexbor/encoding/encode.h +0 -380
  475. data/vendor/lexbor/source/lexbor/encoding/encoding.c +0 -413
  476. data/vendor/lexbor/source/lexbor/encoding/encoding.h +0 -462
  477. data/vendor/lexbor/source/lexbor/encoding/multi.h +0 -63
  478. data/vendor/lexbor/source/lexbor/encoding/multi_res.c +0 -298309
  479. data/vendor/lexbor/source/lexbor/encoding/range.h +0 -35
  480. data/vendor/lexbor/source/lexbor/encoding/range_res.c +0 -71
  481. data/vendor/lexbor/source/lexbor/encoding/res.c +0 -222
  482. data/vendor/lexbor/source/lexbor/encoding/res.h +0 -34
  483. data/vendor/lexbor/source/lexbor/encoding/single.h +0 -117
  484. data/vendor/lexbor/source/lexbor/encoding/single_res.c +0 -13748
  485. data/vendor/lexbor/source/lexbor/engine/base.h +0 -30
  486. data/vendor/lexbor/source/lexbor/engine/config.cmake +0 -2
  487. data/vendor/lexbor/source/lexbor/engine/engine.c +0 -294
  488. data/vendor/lexbor/source/lexbor/engine/engine.h +0 -60
  489. data/vendor/lexbor/source/lexbor/html/attribute_steps.c +0 -159
  490. data/vendor/lexbor/source/lexbor/html/attribute_steps.h +0 -49
  491. data/vendor/lexbor/source/lexbor/html/attribute_steps_res.h +0 -427
  492. data/vendor/lexbor/source/lexbor/html/base.h +0 -44
  493. data/vendor/lexbor/source/lexbor/html/common.c +0 -115
  494. data/vendor/lexbor/source/lexbor/html/common.h +0 -32
  495. data/vendor/lexbor/source/lexbor/html/config.cmake +0 -3
  496. data/vendor/lexbor/source/lexbor/html/element_steps.c +0 -220
  497. data/vendor/lexbor/source/lexbor/html/element_steps.h +0 -47
  498. data/vendor/lexbor/source/lexbor/html/element_steps_res.h +0 -427
  499. data/vendor/lexbor/source/lexbor/html/encoding.c +0 -679
  500. data/vendor/lexbor/source/lexbor/html/encoding.h +0 -243
  501. data/vendor/lexbor/source/lexbor/html/html.h +0 -109
  502. data/vendor/lexbor/source/lexbor/html/interface.c +0 -168
  503. data/vendor/lexbor/source/lexbor/html/interface.h +0 -189
  504. data/vendor/lexbor/source/lexbor/html/interface_res.h +0 -5456
  505. data/vendor/lexbor/source/lexbor/html/interfaces/anchor_element.c +0 -35
  506. data/vendor/lexbor/source/lexbor/html/interfaces/anchor_element.h +0 -34
  507. data/vendor/lexbor/source/lexbor/html/interfaces/area_element.c +0 -35
  508. data/vendor/lexbor/source/lexbor/html/interfaces/area_element.h +0 -34
  509. data/vendor/lexbor/source/lexbor/html/interfaces/audio_element.c +0 -35
  510. data/vendor/lexbor/source/lexbor/html/interfaces/audio_element.h +0 -34
  511. data/vendor/lexbor/source/lexbor/html/interfaces/base_element.c +0 -35
  512. data/vendor/lexbor/source/lexbor/html/interfaces/base_element.h +0 -34
  513. data/vendor/lexbor/source/lexbor/html/interfaces/body_element.c +0 -35
  514. data/vendor/lexbor/source/lexbor/html/interfaces/body_element.h +0 -34
  515. data/vendor/lexbor/source/lexbor/html/interfaces/br_element.c +0 -35
  516. data/vendor/lexbor/source/lexbor/html/interfaces/br_element.h +0 -34
  517. data/vendor/lexbor/source/lexbor/html/interfaces/button_element.c +0 -35
  518. data/vendor/lexbor/source/lexbor/html/interfaces/button_element.h +0 -34
  519. data/vendor/lexbor/source/lexbor/html/interfaces/canvas_element.c +0 -35
  520. data/vendor/lexbor/source/lexbor/html/interfaces/canvas_element.h +0 -34
  521. data/vendor/lexbor/source/lexbor/html/interfaces/d_list_element.c +0 -35
  522. data/vendor/lexbor/source/lexbor/html/interfaces/d_list_element.h +0 -34
  523. data/vendor/lexbor/source/lexbor/html/interfaces/data_element.c +0 -35
  524. data/vendor/lexbor/source/lexbor/html/interfaces/data_element.h +0 -34
  525. data/vendor/lexbor/source/lexbor/html/interfaces/data_list_element.c +0 -35
  526. data/vendor/lexbor/source/lexbor/html/interfaces/data_list_element.h +0 -34
  527. data/vendor/lexbor/source/lexbor/html/interfaces/details_element.c +0 -35
  528. data/vendor/lexbor/source/lexbor/html/interfaces/details_element.h +0 -34
  529. data/vendor/lexbor/source/lexbor/html/interfaces/dialog_element.c +0 -35
  530. data/vendor/lexbor/source/lexbor/html/interfaces/dialog_element.h +0 -34
  531. data/vendor/lexbor/source/lexbor/html/interfaces/directory_element.c +0 -35
  532. data/vendor/lexbor/source/lexbor/html/interfaces/directory_element.h +0 -34
  533. data/vendor/lexbor/source/lexbor/html/interfaces/div_element.c +0 -35
  534. data/vendor/lexbor/source/lexbor/html/interfaces/div_element.h +0 -34
  535. data/vendor/lexbor/source/lexbor/html/interfaces/document.c +0 -512
  536. data/vendor/lexbor/source/lexbor/html/interfaces/document.h +0 -313
  537. data/vendor/lexbor/source/lexbor/html/interfaces/element.c +0 -145
  538. data/vendor/lexbor/source/lexbor/html/interfaces/element.h +0 -137
  539. data/vendor/lexbor/source/lexbor/html/interfaces/embed_element.c +0 -35
  540. data/vendor/lexbor/source/lexbor/html/interfaces/embed_element.h +0 -34
  541. data/vendor/lexbor/source/lexbor/html/interfaces/field_set_element.c +0 -35
  542. data/vendor/lexbor/source/lexbor/html/interfaces/field_set_element.h +0 -34
  543. data/vendor/lexbor/source/lexbor/html/interfaces/font_element.c +0 -35
  544. data/vendor/lexbor/source/lexbor/html/interfaces/font_element.h +0 -34
  545. data/vendor/lexbor/source/lexbor/html/interfaces/form_element.c +0 -35
  546. data/vendor/lexbor/source/lexbor/html/interfaces/form_element.h +0 -34
  547. data/vendor/lexbor/source/lexbor/html/interfaces/frame_element.c +0 -35
  548. data/vendor/lexbor/source/lexbor/html/interfaces/frame_element.h +0 -34
  549. data/vendor/lexbor/source/lexbor/html/interfaces/frame_set_element.c +0 -35
  550. data/vendor/lexbor/source/lexbor/html/interfaces/frame_set_element.h +0 -34
  551. data/vendor/lexbor/source/lexbor/html/interfaces/head_element.c +0 -35
  552. data/vendor/lexbor/source/lexbor/html/interfaces/head_element.h +0 -34
  553. data/vendor/lexbor/source/lexbor/html/interfaces/heading_element.c +0 -35
  554. data/vendor/lexbor/source/lexbor/html/interfaces/heading_element.h +0 -34
  555. data/vendor/lexbor/source/lexbor/html/interfaces/hr_element.c +0 -35
  556. data/vendor/lexbor/source/lexbor/html/interfaces/hr_element.h +0 -34
  557. data/vendor/lexbor/source/lexbor/html/interfaces/html_element.c +0 -35
  558. data/vendor/lexbor/source/lexbor/html/interfaces/html_element.h +0 -34
  559. data/vendor/lexbor/source/lexbor/html/interfaces/iframe_element.c +0 -35
  560. data/vendor/lexbor/source/lexbor/html/interfaces/iframe_element.h +0 -34
  561. data/vendor/lexbor/source/lexbor/html/interfaces/image_element.c +0 -35
  562. data/vendor/lexbor/source/lexbor/html/interfaces/image_element.h +0 -34
  563. data/vendor/lexbor/source/lexbor/html/interfaces/input_element.c +0 -35
  564. data/vendor/lexbor/source/lexbor/html/interfaces/input_element.h +0 -34
  565. data/vendor/lexbor/source/lexbor/html/interfaces/label_element.c +0 -35
  566. data/vendor/lexbor/source/lexbor/html/interfaces/label_element.h +0 -34
  567. data/vendor/lexbor/source/lexbor/html/interfaces/legend_element.c +0 -35
  568. data/vendor/lexbor/source/lexbor/html/interfaces/legend_element.h +0 -34
  569. data/vendor/lexbor/source/lexbor/html/interfaces/li_element.c +0 -35
  570. data/vendor/lexbor/source/lexbor/html/interfaces/li_element.h +0 -34
  571. data/vendor/lexbor/source/lexbor/html/interfaces/link_element.c +0 -35
  572. data/vendor/lexbor/source/lexbor/html/interfaces/link_element.h +0 -34
  573. data/vendor/lexbor/source/lexbor/html/interfaces/map_element.c +0 -35
  574. data/vendor/lexbor/source/lexbor/html/interfaces/map_element.h +0 -34
  575. data/vendor/lexbor/source/lexbor/html/interfaces/marquee_element.c +0 -35
  576. data/vendor/lexbor/source/lexbor/html/interfaces/marquee_element.h +0 -34
  577. data/vendor/lexbor/source/lexbor/html/interfaces/media_element.c +0 -35
  578. data/vendor/lexbor/source/lexbor/html/interfaces/media_element.h +0 -34
  579. data/vendor/lexbor/source/lexbor/html/interfaces/menu_element.c +0 -35
  580. data/vendor/lexbor/source/lexbor/html/interfaces/menu_element.h +0 -34
  581. data/vendor/lexbor/source/lexbor/html/interfaces/meta_element.c +0 -35
  582. data/vendor/lexbor/source/lexbor/html/interfaces/meta_element.h +0 -34
  583. data/vendor/lexbor/source/lexbor/html/interfaces/meter_element.c +0 -35
  584. data/vendor/lexbor/source/lexbor/html/interfaces/meter_element.h +0 -34
  585. data/vendor/lexbor/source/lexbor/html/interfaces/mod_element.c +0 -35
  586. data/vendor/lexbor/source/lexbor/html/interfaces/mod_element.h +0 -34
  587. data/vendor/lexbor/source/lexbor/html/interfaces/o_list_element.c +0 -35
  588. data/vendor/lexbor/source/lexbor/html/interfaces/o_list_element.h +0 -34
  589. data/vendor/lexbor/source/lexbor/html/interfaces/object_element.c +0 -35
  590. data/vendor/lexbor/source/lexbor/html/interfaces/object_element.h +0 -34
  591. data/vendor/lexbor/source/lexbor/html/interfaces/opt_group_element.c +0 -35
  592. data/vendor/lexbor/source/lexbor/html/interfaces/opt_group_element.h +0 -34
  593. data/vendor/lexbor/source/lexbor/html/interfaces/option_element.c +0 -260
  594. data/vendor/lexbor/source/lexbor/html/interfaces/option_element.h +0 -71
  595. data/vendor/lexbor/source/lexbor/html/interfaces/output_element.c +0 -35
  596. data/vendor/lexbor/source/lexbor/html/interfaces/output_element.h +0 -34
  597. data/vendor/lexbor/source/lexbor/html/interfaces/paragraph_element.c +0 -35
  598. data/vendor/lexbor/source/lexbor/html/interfaces/paragraph_element.h +0 -34
  599. data/vendor/lexbor/source/lexbor/html/interfaces/param_element.c +0 -35
  600. data/vendor/lexbor/source/lexbor/html/interfaces/param_element.h +0 -34
  601. data/vendor/lexbor/source/lexbor/html/interfaces/picture_element.c +0 -35
  602. data/vendor/lexbor/source/lexbor/html/interfaces/picture_element.h +0 -34
  603. data/vendor/lexbor/source/lexbor/html/interfaces/pre_element.c +0 -35
  604. data/vendor/lexbor/source/lexbor/html/interfaces/pre_element.h +0 -34
  605. data/vendor/lexbor/source/lexbor/html/interfaces/progress_element.c +0 -35
  606. data/vendor/lexbor/source/lexbor/html/interfaces/progress_element.h +0 -34
  607. data/vendor/lexbor/source/lexbor/html/interfaces/quote_element.c +0 -35
  608. data/vendor/lexbor/source/lexbor/html/interfaces/quote_element.h +0 -34
  609. data/vendor/lexbor/source/lexbor/html/interfaces/script_element.c +0 -35
  610. data/vendor/lexbor/source/lexbor/html/interfaces/script_element.h +0 -34
  611. data/vendor/lexbor/source/lexbor/html/interfaces/search_element.c +0 -35
  612. data/vendor/lexbor/source/lexbor/html/interfaces/search_element.h +0 -34
  613. data/vendor/lexbor/source/lexbor/html/interfaces/select_element.c +0 -318
  614. data/vendor/lexbor/source/lexbor/html/interfaces/select_element.h +0 -52
  615. data/vendor/lexbor/source/lexbor/html/interfaces/selectedcontent_element.c +0 -110
  616. data/vendor/lexbor/source/lexbor/html/interfaces/selectedcontent_element.h +0 -45
  617. data/vendor/lexbor/source/lexbor/html/interfaces/slot_element.c +0 -35
  618. data/vendor/lexbor/source/lexbor/html/interfaces/slot_element.h +0 -34
  619. data/vendor/lexbor/source/lexbor/html/interfaces/source_element.c +0 -35
  620. data/vendor/lexbor/source/lexbor/html/interfaces/source_element.h +0 -34
  621. data/vendor/lexbor/source/lexbor/html/interfaces/span_element.c +0 -35
  622. data/vendor/lexbor/source/lexbor/html/interfaces/span_element.h +0 -34
  623. data/vendor/lexbor/source/lexbor/html/interfaces/style_element.c +0 -36
  624. data/vendor/lexbor/source/lexbor/html/interfaces/style_element.h +0 -35
  625. data/vendor/lexbor/source/lexbor/html/interfaces/table_caption_element.c +0 -35
  626. data/vendor/lexbor/source/lexbor/html/interfaces/table_caption_element.h +0 -34
  627. data/vendor/lexbor/source/lexbor/html/interfaces/table_cell_element.c +0 -35
  628. data/vendor/lexbor/source/lexbor/html/interfaces/table_cell_element.h +0 -34
  629. data/vendor/lexbor/source/lexbor/html/interfaces/table_col_element.c +0 -35
  630. data/vendor/lexbor/source/lexbor/html/interfaces/table_col_element.h +0 -34
  631. data/vendor/lexbor/source/lexbor/html/interfaces/table_element.c +0 -35
  632. data/vendor/lexbor/source/lexbor/html/interfaces/table_element.h +0 -34
  633. data/vendor/lexbor/source/lexbor/html/interfaces/table_row_element.c +0 -35
  634. data/vendor/lexbor/source/lexbor/html/interfaces/table_row_element.h +0 -34
  635. data/vendor/lexbor/source/lexbor/html/interfaces/table_section_element.c +0 -35
  636. data/vendor/lexbor/source/lexbor/html/interfaces/table_section_element.h +0 -34
  637. data/vendor/lexbor/source/lexbor/html/interfaces/template_element.c +0 -45
  638. data/vendor/lexbor/source/lexbor/html/interfaces/template_element.h +0 -38
  639. data/vendor/lexbor/source/lexbor/html/interfaces/text_area_element.c +0 -35
  640. data/vendor/lexbor/source/lexbor/html/interfaces/text_area_element.h +0 -34
  641. data/vendor/lexbor/source/lexbor/html/interfaces/time_element.c +0 -35
  642. data/vendor/lexbor/source/lexbor/html/interfaces/time_element.h +0 -34
  643. data/vendor/lexbor/source/lexbor/html/interfaces/title_element.c +0 -138
  644. data/vendor/lexbor/source/lexbor/html/interfaces/title_element.h +0 -42
  645. data/vendor/lexbor/source/lexbor/html/interfaces/track_element.c +0 -35
  646. data/vendor/lexbor/source/lexbor/html/interfaces/track_element.h +0 -34
  647. data/vendor/lexbor/source/lexbor/html/interfaces/u_list_element.c +0 -35
  648. data/vendor/lexbor/source/lexbor/html/interfaces/u_list_element.h +0 -34
  649. data/vendor/lexbor/source/lexbor/html/interfaces/unknown_element.c +0 -35
  650. data/vendor/lexbor/source/lexbor/html/interfaces/unknown_element.h +0 -34
  651. data/vendor/lexbor/source/lexbor/html/interfaces/video_element.c +0 -35
  652. data/vendor/lexbor/source/lexbor/html/interfaces/video_element.h +0 -34
  653. data/vendor/lexbor/source/lexbor/html/interfaces/window.c +0 -36
  654. data/vendor/lexbor/source/lexbor/html/interfaces/window.h +0 -34
  655. data/vendor/lexbor/source/lexbor/html/node.c +0 -14
  656. data/vendor/lexbor/source/lexbor/html/node.h +0 -73
  657. data/vendor/lexbor/source/lexbor/html/parser.c +0 -498
  658. data/vendor/lexbor/source/lexbor/html/parser.h +0 -192
  659. data/vendor/lexbor/source/lexbor/html/serialize.c +0 -2041
  660. data/vendor/lexbor/source/lexbor/html/serialize.h +0 -94
  661. data/vendor/lexbor/source/lexbor/html/serialize_ext.c +0 -2129
  662. data/vendor/lexbor/source/lexbor/html/serialize_ext.h +0 -672
  663. data/vendor/lexbor/source/lexbor/html/tag.c +0 -30
  664. data/vendor/lexbor/source/lexbor/html/tag.h +0 -83
  665. data/vendor/lexbor/source/lexbor/html/tag_res.h +0 -1912
  666. data/vendor/lexbor/source/lexbor/html/token.c +0 -388
  667. data/vendor/lexbor/source/lexbor/html/token.h +0 -147
  668. data/vendor/lexbor/source/lexbor/html/token_attr.c +0 -44
  669. data/vendor/lexbor/source/lexbor/html/token_attr.h +0 -67
  670. data/vendor/lexbor/source/lexbor/html/tokenizer/error.c +0 -106
  671. data/vendor/lexbor/source/lexbor/html/tokenizer/error.h +0 -153
  672. data/vendor/lexbor/source/lexbor/html/tokenizer/res.h +0 -4950
  673. data/vendor/lexbor/source/lexbor/html/tokenizer/state.c +0 -2582
  674. data/vendor/lexbor/source/lexbor/html/tokenizer/state.h +0 -251
  675. data/vendor/lexbor/source/lexbor/html/tokenizer/state_comment.c +0 -496
  676. data/vendor/lexbor/source/lexbor/html/tokenizer/state_comment.h +0 -27
  677. data/vendor/lexbor/source/lexbor/html/tokenizer/state_doctype.c +0 -1659
  678. data/vendor/lexbor/source/lexbor/html/tokenizer/state_doctype.h +0 -27
  679. data/vendor/lexbor/source/lexbor/html/tokenizer/state_rawtext.c +0 -303
  680. data/vendor/lexbor/source/lexbor/html/tokenizer/state_rawtext.h +0 -32
  681. data/vendor/lexbor/source/lexbor/html/tokenizer/state_rcdata.c +0 -311
  682. data/vendor/lexbor/source/lexbor/html/tokenizer/state_rcdata.h +0 -32
  683. data/vendor/lexbor/source/lexbor/html/tokenizer/state_script.c +0 -1209
  684. data/vendor/lexbor/source/lexbor/html/tokenizer/state_script.h +0 -32
  685. data/vendor/lexbor/source/lexbor/html/tokenizer.c +0 -812
  686. data/vendor/lexbor/source/lexbor/html/tokenizer.h +0 -389
  687. data/vendor/lexbor/source/lexbor/html/tree/active_formatting.c +0 -241
  688. data/vendor/lexbor/source/lexbor/html/tree/active_formatting.h +0 -117
  689. data/vendor/lexbor/source/lexbor/html/tree/error.c +0 -94
  690. data/vendor/lexbor/source/lexbor/html/tree/error.h +0 -130
  691. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_after_body.c +0 -73
  692. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_after_frameset.c +0 -74
  693. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_body.c +0 -93
  694. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_frameset.c +0 -98
  695. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_head.c +0 -232
  696. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/before_head.c +0 -154
  697. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/before_html.c +0 -176
  698. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/foreign_content.c +0 -384
  699. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_body.c +0 -2175
  700. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_caption.c +0 -164
  701. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_cell.c +0 -203
  702. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_column_group.c +0 -211
  703. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_frameset.c +0 -159
  704. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_head.c +0 -378
  705. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_head_noscript.c +0 -129
  706. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_row.c +0 -211
  707. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_table.c +0 -482
  708. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_table_body.c +0 -208
  709. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_table_text.c +0 -127
  710. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_template.c +0 -193
  711. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/initial.c +0 -422
  712. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/text.c +0 -70
  713. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode.h +0 -127
  714. data/vendor/lexbor/source/lexbor/html/tree/open_elements.c +0 -337
  715. data/vendor/lexbor/source/lexbor/html/tree/open_elements.h +0 -101
  716. data/vendor/lexbor/source/lexbor/html/tree/open_elements_res.h +0 -427
  717. data/vendor/lexbor/source/lexbor/html/tree/template_insertion.c +0 -10
  718. data/vendor/lexbor/source/lexbor/html/tree/template_insertion.h +0 -100
  719. data/vendor/lexbor/source/lexbor/html/tree.c +0 -1764
  720. data/vendor/lexbor/source/lexbor/html/tree.h +0 -404
  721. data/vendor/lexbor/source/lexbor/html/tree_res.h +0 -111
  722. data/vendor/lexbor/source/lexbor/ns/base.h +0 -32
  723. data/vendor/lexbor/source/lexbor/ns/config.cmake +0 -2
  724. data/vendor/lexbor/source/lexbor/ns/const.h +0 -37
  725. data/vendor/lexbor/source/lexbor/ns/ns.c +0 -155
  726. data/vendor/lexbor/source/lexbor/ns/ns.h +0 -66
  727. data/vendor/lexbor/source/lexbor/ns/res.h +0 -97
  728. data/vendor/lexbor/source/lexbor/ports/posix/config.cmake +0 -15
  729. data/vendor/lexbor/source/lexbor/ports/posix/lexbor/core/fs.c +0 -236
  730. data/vendor/lexbor/source/lexbor/ports/posix/lexbor/core/memory.c +0 -53
  731. data/vendor/lexbor/source/lexbor/ports/posix/lexbor/core/perf.c +0 -214
  732. data/vendor/lexbor/source/lexbor/ports/posix/port.conf +0 -5
  733. data/vendor/lexbor/source/lexbor/ports/windows_nt/config.cmake +0 -18
  734. data/vendor/lexbor/source/lexbor/ports/windows_nt/lexbor/core/fs.c +0 -239
  735. data/vendor/lexbor/source/lexbor/ports/windows_nt/lexbor/core/memory.c +0 -53
  736. data/vendor/lexbor/source/lexbor/ports/windows_nt/lexbor/core/perf.c +0 -81
  737. data/vendor/lexbor/source/lexbor/ports/windows_nt/port.conf +0 -3
  738. data/vendor/lexbor/source/lexbor/punycode/base.h +0 -30
  739. data/vendor/lexbor/source/lexbor/punycode/config.cmake +0 -3
  740. data/vendor/lexbor/source/lexbor/punycode/punycode.c +0 -678
  741. data/vendor/lexbor/source/lexbor/punycode/punycode.h +0 -109
  742. data/vendor/lexbor/source/lexbor/selectors/base.h +0 -30
  743. data/vendor/lexbor/source/lexbor/selectors/config.cmake +0 -2
  744. data/vendor/lexbor/source/lexbor/selectors/selectors.c +0 -2378
  745. data/vendor/lexbor/source/lexbor/selectors/selectors.h +0 -282
  746. data/vendor/lexbor/source/lexbor/style/attribute_steps.c +0 -158
  747. data/vendor/lexbor/source/lexbor/style/attribute_steps.h +0 -49
  748. data/vendor/lexbor/source/lexbor/style/attribute_steps_res.h +0 -427
  749. data/vendor/lexbor/source/lexbor/style/base.h +0 -52
  750. data/vendor/lexbor/source/lexbor/style/config.cmake +0 -2
  751. data/vendor/lexbor/source/lexbor/style/dom/interfaces/document.c +0 -544
  752. data/vendor/lexbor/source/lexbor/style/dom/interfaces/document.h +0 -96
  753. data/vendor/lexbor/source/lexbor/style/dom/interfaces/element.c +0 -795
  754. data/vendor/lexbor/source/lexbor/style/dom/interfaces/element.h +0 -125
  755. data/vendor/lexbor/source/lexbor/style/element_steps.c +0 -180
  756. data/vendor/lexbor/source/lexbor/style/element_steps.h +0 -44
  757. data/vendor/lexbor/source/lexbor/style/element_steps_res.h +0 -427
  758. data/vendor/lexbor/source/lexbor/style/html/interfaces/document.c +0 -182
  759. data/vendor/lexbor/source/lexbor/style/html/interfaces/document.h +0 -214
  760. data/vendor/lexbor/source/lexbor/style/html/interfaces/element.c +0 -293
  761. data/vendor/lexbor/source/lexbor/style/html/interfaces/element.h +0 -211
  762. data/vendor/lexbor/source/lexbor/style/html/interfaces/option_element.c +0 -91
  763. data/vendor/lexbor/source/lexbor/style/html/interfaces/option_element.h +0 -49
  764. data/vendor/lexbor/source/lexbor/style/html/interfaces/style_element.c +0 -131
  765. data/vendor/lexbor/source/lexbor/style/html/interfaces/style_element.h +0 -41
  766. data/vendor/lexbor/source/lexbor/style/style.c +0 -48
  767. data/vendor/lexbor/source/lexbor/style/style.h +0 -40
  768. data/vendor/lexbor/source/lexbor/style/tree/open_elements_res.h +0 -427
  769. data/vendor/lexbor/source/lexbor/tag/base.h +0 -32
  770. data/vendor/lexbor/source/lexbor/tag/config.cmake +0 -2
  771. data/vendor/lexbor/source/lexbor/tag/const.h +0 -230
  772. data/vendor/lexbor/source/lexbor/tag/res.h +0 -568
  773. data/vendor/lexbor/source/lexbor/tag/tag.c +0 -143
  774. data/vendor/lexbor/source/lexbor/tag/tag.h +0 -121
  775. data/vendor/lexbor/source/lexbor/unicode/base.h +0 -157
  776. data/vendor/lexbor/source/lexbor/unicode/config.cmake +0 -3
  777. data/vendor/lexbor/source/lexbor/unicode/idna.c +0 -748
  778. data/vendor/lexbor/source/lexbor/unicode/idna.h +0 -264
  779. data/vendor/lexbor/source/lexbor/unicode/res.h +0 -206549
  780. data/vendor/lexbor/source/lexbor/unicode/unicode.c +0 -1039
  781. data/vendor/lexbor/source/lexbor/unicode/unicode.h +0 -405
  782. data/vendor/lexbor/source/lexbor/url/base.h +0 -32
  783. data/vendor/lexbor/source/lexbor/url/config.cmake +0 -4
  784. data/vendor/lexbor/source/lexbor/url/url.c +0 -5791
  785. data/vendor/lexbor/source/lexbor/url/url.h +0 -984
  786. data/vendor/lexbor/source/lexbor/utils/base.h +0 -32
  787. data/vendor/lexbor/source/lexbor/utils/config.cmake +0 -2
  788. data/vendor/lexbor/source/lexbor/utils/http.c +0 -555
  789. data/vendor/lexbor/source/lexbor/utils/http.h +0 -90
  790. data/vendor/lexbor/source/lexbor/utils/utils.h +0 -15
  791. data/vendor/lexbor/source/lexbor/utils/warc.c +0 -817
  792. data/vendor/lexbor/source/lexbor/utils/warc.h +0 -126
  793. data/vendor/lexbor/version +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80c74b7d335f5f5f93f8476a8f99a8918560df8cf75f43a5a71d9b132e892873
4
- data.tar.gz: d6593459917f22ceb301093d17b981a597d8be7d975d1fab1e4142f6cf17fcbc
3
+ metadata.gz: dc64f5f05d50f24d910c10e0fc9083f90db3739e73f2ab83d801e8775f2a62f4
4
+ data.tar.gz: 46db21d534703f776deeeff576a612e810f6926ceb41f335c1c42097edd472c9
5
5
  SHA512:
6
- metadata.gz: efa98c3ca322d6a3ee141428c1f5e9c3e5b46fba9dde4d7ac75d7dcfdf27d4dd083ef46eed5fb8db21685396d86caeb58e1755f9dd5014d396674cc149378df9
7
- data.tar.gz: 836d97359577dfcd4bd60a8de0dfcf355c596b95fa7fffd5e56a0a355bb4267f3141bf8786f4f905596d79bef44721eeb3bfe4f25fa97e489c5aa3319c9f7655
6
+ metadata.gz: 07ff20653102efa921a4079b10ead383074a7f4a3a97c1cd84134ffd344b30f61fe5f19d094a45be7b5cd514e91f029cf02c5bc44098d9a408f62b1c1551d66b
7
+ data.tar.gz: d241369c7b6e7a2be95827e0724bdcc0f58ce79cbbbe1d3937bc6708ee0d438af966ae5eccc9319e2fb940638e80faed7564808c51b032b0877bf179223d7e02
data/CHANGELOG.md CHANGED
@@ -1,5 +1,211 @@
1
1
  # Changelog
2
2
 
3
+ ## [Unreleased]
4
+
5
+ ## [0.17.0.rc2] - 2026-10-24
6
+
7
+ ### Added
8
+
9
+ * HTML documents are decoded as browsers decode them: the HTML Standard's
10
+ encoding sniffing algorithm with the Encoding Standard's decoders. A
11
+ binary (ASCII-8BIT) or US-ASCII String is read in the encoding its byte
12
+ order mark or `<meta>` declares, or as UTF-8 when it is valid UTF-8, or
13
+ else in a detected encoding (Shift_JIS, EUC-JP, ISO-2022-JP, ...); a
14
+ `<meta>` past the first 1024 bytes re-reads the document in the encoding
15
+ it names. `Makiri::HTML(src, encoding: "shift_jis")` gives the encoding
16
+ outright - read as a String tagged with it is read, so
17
+ `encoding: Encoding::UTF_32LE` works - and `Document#encoding` returns
18
+ the one used (it was always `"UTF-8"`).
19
+
20
+ ### Changed
21
+
22
+ * Ruby 3.3 or newer is required (3.2 reached its end of life in March 2026).
23
+ * Arguments are no longer converted with `to_s` / `to_str`. A string
24
+ argument (an attribute value, text content, markup, a variable value, a
25
+ namespace URI) must be a `String`, and a name (an attribute or element
26
+ name, a namespace prefix, a selector or an XPath expression) a `String` or
27
+ a `Symbol`; anything else raises `TypeError` ("... call #to_s to convert
28
+ it"), where `node["n"] = 1` used to store `"1"`. `Makiri.HTML` /
29
+ `Makiri.XML` still read an IO and convert their source with `String()`,
30
+ and `XML::Builder` still converts with `to_s`. An index or a count
31
+ (`NodeSet#[]`, `#child_at`, `to_xml(indent:)`) must likewise be an
32
+ `Integer`; `to_int` is not called.
33
+ * A binary or US-ASCII String holding invalid UTF-8 is no longer read as
34
+ UTF-8 with U+FFFD replacements: it is sniffed, and read in the encoding a
35
+ detector guesses - which, for short text or text with little variety,
36
+ can be the wrong one. A single invalid byte is enough: UTF-8 with one
37
+ stray byte, or cut off inside a character, is read whole as a legacy
38
+ encoding (windows-1252, say), as a browser reads such a local file. Pass
39
+ `encoding:` when it is known, `"utf-8"` (or a UTF-8 String) for the old
40
+ reading.
41
+ * A String in a legacy encoding is decoded with the Encoding Standard's
42
+ decoder for it rather than Ruby's transcoder, as browsers decode it:
43
+ `ISO-8859-1` reads as windows-1252 (`\x80` is `€`), and Shift_JIS's
44
+ `0x8160` is U+301C where Ruby's `Windows-31J` made U+FF5E.
45
+ * Selectors, XPath expressions, names, attribute values and text read a
46
+ String in its own encoding, as parsing does: one that is not UTF-8,
47
+ US-ASCII or binary is converted to UTF-8 first, and refused with
48
+ `Makiri::Error` when it cannot be. Its bytes were read as UTF-8, so a
49
+ Windows-1252 `"\xC3\xA9"` was stored as `é` and a UTF-16 `"a"` as `"a\0"`.
50
+ * `Makiri::XML` reads an encoding declaration by its IANA charset name or
51
+ alias in any case (`latin1`, `csISOLatin1`), as XML 1.0 has it, and
52
+ raises `Makiri::XML::SyntaxError` for a name that is neither (`utf8`);
53
+ such a declaration was ignored, or reported as conflicting with the
54
+ String's encoding.
55
+ * `Makiri::XML` `#ancestors` returns a NodeSet, as HTML's does; it returned
56
+ an Array.
57
+ * `Node#traverse` lists the subtree once, natively, before the first node is
58
+ yielded: about five times faster on a large tree, and a block that adds or
59
+ removes nodes no longer changes which nodes are visited.
60
+
61
+ ### Removed
62
+
63
+ * XPath custom-function handlers. `Node#xpath(expr, handler)`,
64
+ `#at_xpath(expr, handler)` and `XPathContext#evaluate(expr, handler)` raise
65
+ `ArgumentError`, and a call to a function XPath 1.0 does not define is an
66
+ `XPath::SyntaxError` (it was a `Makiri::Error` when the expression was
67
+ evaluated). No Ruby code runs during an evaluation any more, so mutating a
68
+ document is never refused "while evaluating XPath over it".
69
+
70
+ ### Performance
71
+
72
+ * A node wrapper keeps its data in its own object (an embedded TypedData,
73
+ Ruby 3.3+): wrapping a node for the first time is ~25-45 ns cheaper, and
74
+ a fresh document's query or walk 10-30% faster.
75
+ * A document's indexes are built when a query first needs them, each in
76
+ one walk. An XPath that names no tag (`/html/body`) no longer builds the
77
+ tag index; the text index waits until `#text` calls have walked half the
78
+ document, so a first `doc.text` is twice as fast and a first small
79
+ `li.text` builds nothing; and the order XPath sorts by is kept with the
80
+ document, so a union over 40,000 nodes sorts in 0.7 ms instead of 13 ms.
81
+ * A NodeSet of up to eight nodes holds them in itself, with no allocation
82
+ of its own: `#children` went from ~185 to ~120 ns.
83
+ * A reader that returns a String (`#text`, `#name`, `#[]`) builds it with
84
+ no intermediate copy (`#text` ~124 -> ~112 ns), and `Document#text` joins
85
+ its text with fixed-size copies (20 KB: 9.2 -> 6.7 us).
86
+
87
+ ### Fixed
88
+
89
+ * HTML `add_previous_sibling`, `add_next_sibling` and `replace` given the
90
+ node itself leave it where it is, as the DOM does and `Makiri::XML`
91
+ already did; they raised "cannot insert a node into its own subtree".
92
+ * `Makiri::XML`'s `content=` on a DocumentFragment replaces its children,
93
+ and on a Document or a DocumentType does nothing, as the DOM's
94
+ `textContent` does and HTML already did; both raised.
95
+ * `remove` / `unlink` on an HTML Document raise "cannot remove the document
96
+ node", as on an XML one; it returned the document unchanged.
97
+ * A UTF-8 byte order mark at the start of a document is no longer kept as a
98
+ U+FEFF character in the text.
99
+ * A refused `Makiri::XML` insert of a node from another document (onto a
100
+ Text node, say) no longer leaves the copy it made in the target document,
101
+ where each refused call grew it and used up its node budget.
102
+ * XPath over HTML keeps a plain attribute of an element created in the
103
+ XMLNS namespace on `@*` and `[@name]`; it was taken for a namespace
104
+ declaration and skipped.
105
+ * XPath's `id()` with many tokens indexes the document's IDs once instead
106
+ of searching it per token: 8,000 IDs over 8,000 elements raised
107
+ `Makiri::XPath::LimitExceeded`.
108
+ * `==` / `eql?` compare the nodes' Documents as well, so nodes of two
109
+ documents can no longer compare equal after the per-document counter wraps.
110
+ * Importing an XML processing instruction whose data holds `?>` into an
111
+ HTML document raises `ArgumentError`; it reported "out of memory".
112
+ * An HTML Attr serializes to the empty string, as an XML Attr does and as
113
+ DOM Parsing and Firefox have it: `attr.to_s`, `puts attr` and `NodeSet#to_s`
114
+ over attributes raised `Makiri::Error` ("HTML serialization failed").
115
+ * Under a default namespace (the ns Hash's `"xmlns"`), a compound with no
116
+ type selector (`.x`, `[a]`) matches only that namespace's elements, as if
117
+ `*` were written (Selectors 4); it matched elements in any namespace.
118
+ * An undeclared namespace prefix inside `:is()` or `:where()` drops that
119
+ alternative alone, as browsers do: `:is(a, z|a)` matches `a` instead of
120
+ raising `Makiri::CSS::SyntaxError`.
121
+
122
+ ## [0.17.0.rc1] - 2026-10-22
123
+
124
+ ### Added
125
+
126
+ * `Makiri::Lexbor::CSS.parse_stylesheet` returns the declarations in an
127
+ at-rule's block (`@font-face`, `@page`, ...) as its `:declarations`; they
128
+ were dropped.
129
+
130
+ ### Changed
131
+
132
+ * HTML is parsed by Makiri's own Rust port of Lexbor's tokenizer and tree
133
+ builder, into a DOM of Makiri's own, and the CSS selector and stylesheet
134
+ parsers are ported too. A parsed document takes about 40% less memory.
135
+ * Installing from source needs Rust 1.84 or newer (and libclang), and no
136
+ longer CMake: the gem carries none of Lexbor's sources, only its LICENSE
137
+ and NOTICE.
138
+ * `Makiri::XML`'s `#css`, `#at_css` and `#matches?` run on the same matcher
139
+ as HTML's and answer as a browser's `querySelectorAll` does in an XML
140
+ document, 10-20x faster on compound selectors (`.item`, `ul li.item`).
141
+ This changes some answers:
142
+ * a bare type selector (`p`) matches that name in any namespace;
143
+ * the root element's namespace declarations are no longer picked up: a
144
+ prefix must be given in the ns Hash, whose `"xmlns"` entry is the
145
+ default namespace (on HTML too);
146
+ * a selector run on a node may match through ancestors outside it
147
+ (`node.css("body p")`); only the node's descendants are returned;
148
+ * `[a=v i]`, `:nth-child(... of S)`, and the form-state and link
149
+ pseudo-classes on XHTML elements are supported;
150
+ * `||` and `:current()` raise `Makiri::CSS::SyntaxError`, and an over-long
151
+ chain `Makiri::Error` (it was `Makiri::XPath::LimitExceeded`).
152
+ * HTML `css(selector, ns)` resolves namespace prefixes: `svg|path` is the SVG
153
+ `path`, `|p` an element in no namespace, `[x|href]` the attribute in `x`'s
154
+ namespace. A prefix the Hash does not bind raises
155
+ `Makiri::CSS::SyntaxError`; prefixes used to be ignored.
156
+ * HTML parsing follows the HTML Standard where Lexbor did not. This affects
157
+ malformed or unusual markup only: `<frameset>`, `<form>` and tables inside
158
+ `<template>`, `<![CDA` or `<!` at the end of the input, the adoption
159
+ agency, `<textarea>`, `<input type=HIDDEN>` and `<image>` in a table,
160
+ `<sup>` in SVG or MathML, and a repeated attribute name (the first is
161
+ kept). Fragment parsing (`#inner_html=`, `#outer_html=`, `Node#parse`,
162
+ `context:` given an element) takes the context element's quirks mode,
163
+ namespace and ancestor `<form>` into account, as browsers do.
164
+ * CSS selectors are parsed as Selectors 4 says: `:has()` inside `:has()` and
165
+ an invalid argument to `:has()` make the selector invalid, an empty
166
+ `:is()` / `:where()` is valid and matches nothing, and `#1a` is not an ID
167
+ selector.
168
+ * `parse_stylesheet` reads names and values by one rule for every property: a
169
+ declaration name is lower-cased unless it is a custom property, an at-rule
170
+ name is lower-cased, and a value is the text as written with whitespace
171
+ runs collapsed (`color: RED` stays `RED`; it came back as `red`).
172
+ `:specificity` is counted as Selectors 4 does (`:is()` / `:not()` /
173
+ `:has()` take their most specific argument).
174
+
175
+ ### Removed
176
+
177
+ * The 10,000-`<option>` limit on a `<select>`: a select with any number of
178
+ options parses in linear time, as browsers parse it.
179
+
180
+ ### Fixed
181
+
182
+ * `parse_stylesheet` keeps a rule such as `a:hover { ... }` inside `@media`
183
+ or `@supports`; it was read as a declaration, which dropped that rule and
184
+ every one after it in the block. A comment between a declaration's name
185
+ and its `:` no longer drops the declarations that follow.
186
+ * A namespaced type selector in the middle of a compound (`.x|a`) raises
187
+ `Makiri::CSS::SyntaxError`, as browsers do.
188
+ * `:any-link` / `:link` match only an HTML `a` or `area`, or an SVG `a`, with
189
+ an `href` (`<link href>` and `<map>` matched). `:read-write` /
190
+ `:read-only` follow the HTML Standard (a checkbox is read-only, an element
191
+ inside `contenteditable` is read-write), and `:empty` ignores processing
192
+ instructions.
193
+ * HTML's `:nth-child` family counts element siblings only:
194
+ `html:first-child` matched nothing after `<!doctype html>`.
195
+ * An attribute keeps the namespace it was made in: `set_attribute_ns` in the
196
+ element's own namespace replaces the attribute it set before instead of
197
+ adding a second, and an attribute removed from its element keeps its
198
+ `namespace_uri`.
199
+ * An attribute name is serialized in the case it was set (`e["viewBox"]` on
200
+ an element in no namespace was written lower-cased).
201
+ * A void element's `#inner_html` is empty even when it has children, and a
202
+ prefixed HTML, SVG or MathML element is written by its local name.
203
+ * `Node#line` of a void element fostered out of a table is its line, not nil.
204
+ * Many namespaces created with `create_element_ns` no longer make lookups
205
+ quadratic.
206
+ * `HTML::Document#import_node` given a document raises "cannot import a
207
+ document; use #dup", as `#clone_node` does.
208
+
3
209
  ## [0.16.0] - 2026-10-10
4
210
 
5
211
  ### Added
@@ -41,11 +41,20 @@ what browsers do - rather than libxml2. Detailed, test-backed notes live in
41
41
  and in XPath's data model. An `xmlns` on an HTML element is an ordinary
42
42
  attribute and stays visible.
43
43
 
44
- * A `StandardError` raised by a custom-function handler becomes `Makiri::Error`
45
- ("handler raised: <message>"), with the handler's exception as its `#cause`
46
- * Nokogiri re-raises the handler's exception itself. Anything that is not a
47
- `StandardError` (`Interrupt`, `SystemExit`, Timeout's exception) and a
48
- `throw` reach the caller unchanged in both.
44
+ * Arguments are not converted
45
+ * Nokogiri calls `to_s` on an attribute value, text content or a variable
46
+ value (`node["n"] = 1`). Makiri takes a `String` for those, and a `String`
47
+ or a `Symbol` for a name; anything else is a `TypeError`. The parse
48
+ entries still take an IO or anything `String()` converts, and
49
+ `XML::Builder` converts with `to_s` as Nokogiri's does.
50
+ * An index is an `Integer`: `node_set[1.5]` and a Range with a Float end
51
+ are a `TypeError`, where Nokogiri (as `Array#[]`) truncates them.
52
+
53
+ * There are no custom XPath functions
54
+ * Nokogiri answers a function XPath does not define by calling a method of
55
+ a handler object (`xpath("my-fn(.)", handler)`). Makiri runs no Ruby while
56
+ it evaluates: a call to a function XPath 1.0 does not define is an
57
+ `XPath::SyntaxError`, and a handler argument is an `ArgumentError`.
49
58
 
50
59
  * A number literal is read as the nearest double; libxml2's own reader is not
51
60
  correctly rounded for a literal with more digits than a double holds, so
@@ -149,7 +158,7 @@ what browsers do - rather than libxml2. Detailed, test-backed notes live in
149
158
  * `<?php ... ?>` in HTML input is a **ProcessingInstruction** node; `#to_html`
150
159
  writes it back as `<?php ... ?>`, and `<?` at end of input is ignored.
151
160
  * The HTML Standard added processing-instruction tokens and tree-construction
152
- rules for them; Makiri follows them through Lexbor. `Nokogiri::HTML5` (gumbo)
161
+ rules for them, and Makiri's parser follows them. `Nokogiri::HTML5` (gumbo)
153
162
  still produces the older bogus comment (`<!--?php ... ?-->`), and
154
163
  `Nokogiri::HTML` (libxml2) its own comment.
155
164
 
@@ -158,17 +167,39 @@ what browsers do - rather than libxml2. Detailed, test-backed notes live in
158
167
  Nokogiri's. `inner_html=`, `outer_html=` and `Node#parse` take no keyword.
159
168
  `Nokogiri::HTML` (libxml2) instead stops at depth 256 and returns the
160
169
  truncated document.
161
- * More than 10,000 `<option>`s in one `<select>` raise `Makiri::Error`;
162
- Nokogiri has no such limit.
170
+
171
+ * A document's bytes are decoded by the HTML Standard's **encoding sniffing
172
+ algorithm**, with the Encoding Standard's decoders, and `Document#encoding`
173
+ is the encoding they were read in (`"Shift_JIS"`, `"windows-1252"`).
174
+ * A binary (ASCII-8BIT) or US-ASCII String with no `<meta>` charset is read
175
+ as UTF-8 when it is valid UTF-8 and is otherwise detected (Shift_JIS,
176
+ EUC-JP, ISO-2022-JP, ...), as browsers read a local file. One invalid
177
+ byte - a stray one, or a character cut off at the end - rules UTF-8 out,
178
+ and the whole document is read in the detected encoding; pass
179
+ `encoding: "utf-8"` for input known to be UTF-8, and only the bad bytes
180
+ become U+FFFD. `Nokogiri::HTML5` reads it as windows-1252, so valid
181
+ UTF-8 and Shift_JIS alike come out garbled.
182
+ * A `<meta>` charset past the first 1024 bytes re-reads the document in that
183
+ encoding, as browsers do; `Nokogiri::HTML5` ignores it.
184
+ * A String with an encoding is read in that encoding, and `encoding:` gives
185
+ one explicitly; a `<meta>` cannot override either. Both use the Encoding
186
+ Standard's decoders rather than Ruby's transcoders, so `ISO-8859-1` reads
187
+ as windows-1252 (`\x80` is `€`) and Shift_JIS's `0x8160` is U+301C, as in
188
+ browsers.
189
+ * `Nokogiri::HTML5`'s `#encoding` is always `"UTF-8"`.
163
190
 
164
191
  ## HTML mutation
165
192
 
193
+ * `Node#traverse` lists the subtree before the first node is yielded
194
+ * Nokogiri reads each node's children as it reaches it, so a block that
195
+ adds a node below or after the current one can have it visited. Makiri
196
+ visits the nodes there were when `traverse` was called, in the same
197
+ order (each node after its children).
166
198
  * There is no `Node#name=` / `#node_name=` (on HTML or XML nodes). Nokogiri
167
199
  renames a node in place and keeps its identity; the DOM has no rename, and
168
- Lexbor keeps elements such as `<template>`, `<option>` and `<style>` in
169
- structs of their own, so a node cannot change its tag safely. Create an
170
- element of the new name, move the attributes and children, and `replace`
171
- the old one (see CHANGELOG.md).
200
+ an element's tag decides what it is (a `<template>` owns its contents), so a
201
+ node cannot change its tag. Create an element of the new name, move the
202
+ attributes and children, and `replace` the old one (see CHANGELOG.md).
172
203
  * Element and attribute names follow the WHATWG DOM's rules
173
204
  * `create_element`, `[]=` and `set_attribute_ns` raise `ArgumentError` for a
174
205
  name the DOM refuses - one holding whitespace, `/`, `>` (or `=` for an
@@ -224,26 +255,19 @@ what browsers do - rather than libxml2. Detailed, test-backed notes live in
224
255
  * One exception to the DOM: an HTML attribute named `xml:lang` (in no
225
256
  namespace) becomes the XML namespace's `xml:lang`, as the XML reader reads
226
257
  that name, so XHTML-style HTML still writes as XML.
227
- * A known gap, in Lexbor's tag table: an HTML document that already holds a
228
- parsed element named with a colon (`<x:y>`, one local name) and then
229
- receives, by `import_node` from another document, a prefixed element
230
- written the same way (`x:y` from XML: prefix `x`, local name `y`) re-points
231
- the table's entry for that spelling - the parsed element then no longer
232
- matches CSS `x\:y`. Copies within one document do not touch the table.
233
258
  * An XML element with a prefix, imported into HTML, keeps it (`h:div` in
234
259
  XHTML has the local name `div`). Two readers then disagree, as they do in
235
- browsers: CSS's `div` matches it (Lexbor matches the local name), XPath's
236
- `//div` does not (an HTML element's name test reads its qualified name). And
237
- Lexbor's HTML serializer writes the prefix (`<h:div>`), where the HTML
238
- standard writes the local name, so the HTML does not re-parse to the same
239
- element.
260
+ browsers: CSS's `div` matches it (the matcher compares the local name),
261
+ XPath's `//div` does not (an HTML element's name test reads its qualified
262
+ name). `#to_html` writes the local name (`<div>`), as the HTML standard
263
+ does.
240
264
 
241
265
  ## CSS
242
266
 
243
267
  * Most jQuery/Nokogiri CSS extensions are not supported (`:gt`, `:lt`, `:eq`, `:first`, ...)
244
- * Makiri uses Lexbor's selector engine, which is standards-based apart from one
245
- text-containment extension. Use XPath (`xpath("//p[contains(., 'x')]")`) or
246
- Enumerable (`css('li')[1]`) for the rest.
268
+ * Makiri's selector engine is standards-based. Use XPath
269
+ (`xpath("//p[contains(., 'x')]")`) or Enumerable (`css('li')[1]`) for the
270
+ rest.
247
271
  Standard Level-4 selectors (`:is` / `:where` / `:has`) are supported; some of which Nokogiri rejects.
248
272
  * There is no text-containment pseudo-class. Nokogiri's `:contains()` is
249
273
  not supported, and neither is Lexbor's `:lexbor-contains()`: it raises
@@ -255,33 +279,45 @@ what browsers do - rather than libxml2. Detailed, test-backed notes live in
255
279
  selector) is supported and correct on both HTML and XML - the "type" is the
256
280
  element's own expanded name.
257
281
  * Nokogiri (XML and HTML5) mistranslates these to first-/only-child
258
- (`//*[position()=1]` / `//*[last()=1]`), so it under-matches; Makiri matches
259
- Lexbor's HTML matcher.
260
- * HTML CSS takes a `{prefix => uri}` Hash (`css(selector, ns)`) but does not
261
- resolve prefixes against it: Lexbor's matcher matches a prefixed type selector
262
- loosely, so `svg|path`, `|path` and `path` all find the SVG element whatever
263
- is bound. `Nokogiri::HTML5` honours the binding (a wrong URI finds nothing).
264
- * The Hash is accepted and unused rather than refused, so the `css(selector,
265
- ns)` a caller writes for both representations works. Use `#xpath`, where a
266
- prefix IS resolved against the bindings, when the namespace matters.
267
- * `Makiri::XML` resolves CSS prefixes properly - it lowers the selector to the
268
- XPath engine, which registers the bindings.
269
- * The same holds for attribute selectors: HTML `[|href]` (no namespace) and
270
- plain `[href]` also find an SVG `xlink:href`, which `Nokogiri::HTML5`
271
- does not.
272
- `Makiri::XML` reads `[|a]` as the no-namespace attribute.
282
+ (`//*[position()=1]` / `//*[last()=1]`), so it under-matches; Makiri does
283
+ not.
284
+ * CSS resolves a namespace prefix against the `{prefix => uri}` Hash
285
+ (`css(selector, ns)`), on HTML and XML alike: `svg|path` is the SVG `path`
286
+ once `svg` is bound, `|path` an element in no namespace, and a prefix the
287
+ Hash does not bind raises `Makiri::CSS::SyntaxError`. `[x|href]` finds the
288
+ XLink `href` once `x` is bound to XLink. The Hash's `"xmlns"` entry is the
289
+ default namespace, as CSS `@namespace` without a prefix sets one: a type or
290
+ universal selector without a prefix is then in it.
291
+ * Without a default, a bare type selector matches its name in any namespace
292
+ (`path` finds the SVG element, `entry` an Atom entry), as a browser's
293
+ `querySelectorAll` does. `Nokogiri::XML` binds a bare name to the root's
294
+ default namespace when no Hash is given, and to no namespace once one is;
295
+ pass `"xmlns" => uri` (or `"xmlns" => ""`) for that reading.
296
+ * `Makiri::XML` does not collect the document's own declarations: a prefix
297
+ is declared by the Hash or not at all. `Nokogiri::XML` collects the
298
+ root's.
299
+ * A bare `*` under a default namespace is in it, as CSS has it;
300
+ `Nokogiri::XML` matches any element.
301
+ * Up to 0.16 HTML accepted the Hash and ignored every prefix, and
302
+ `Makiri::XML` collected the root's declarations as Nokogiri does.
273
303
  * A selector under a node matches the way `Element#querySelectorAll` does in a
274
- browser, not scoped to that node, on HTML: `at_css("#c").css("div p")` finds a
275
- `p` inside `#c` when `#c` is itself a `div`, since the selector is matched
276
- against the whole document and only the results are kept to descendants.
277
- `Nokogiri::HTML5` and `Nokogiri::XML` scope the selector to the node (`#c`
278
- cannot be the `div`), and so does `Makiri::XML`, which lowers the selector to
279
- an XPath from the node. Lexbor has no `:scope`; for a scoped match on HTML,
280
- use XPath from the node (`xpath(".//div//p")`).
281
- * The attribute case modifiers (`[a="x" i]`, `[a="x" s]`): HTML supports both,
282
- through Lexbor's matcher. `Makiri::XML` accepts `s` (case-sensitive, which XML
283
- values are anyway) and refuses `i` with `Makiri::CSS::SyntaxError`. Nokogiri
284
- refuses both on either representation.
304
+ browser, not scoped to that node, on HTML and XML alike:
305
+ `at_css("#c").css("div p")` finds a `p` inside `#c` when `#c` is itself a
306
+ `div`, since the selector is matched against the whole tree and only the
307
+ results are kept to descendants. `Nokogiri::HTML5` and `Nokogiri::XML` scope
308
+ the selector to the node (`#c` cannot be the `div`), and so did
309
+ `Makiri::XML` up to 0.16. There is no `:scope`; for a scoped match, use XPath
310
+ from the node (`xpath(".//div//p")`).
311
+ * The attribute case modifiers (`[a="x" i]`, `[a="x" s]`) are supported on
312
+ both representations. Nokogiri refuses both on either.
313
+ * The form-state and link pseudo-classes (`:checked`, `:disabled`,
314
+ `:enabled`, `:required`, `:optional`, `:placeholder-shown`, `:link`, ...)
315
+ answer on `Makiri::XML` too, for XHTML elements, as browsers do in an XML
316
+ document; on any other element they match nothing. `Nokogiri::XML` refuses
317
+ them.
318
+ * A selector `Makiri` cannot run (the column combinator `||`, `:current()`)
319
+ raises `Makiri::CSS::SyntaxError`, as a browser's `querySelectorAll` throws a
320
+ SyntaxError, on both representations.
285
321
  * `#matches?` answers for a DETACHED node (`document.create_element("p")
286
322
  .matches?("p")` is true, on both representations). Nokogiri raises
287
323
  `NoMethodError` there - it implements `#matches?` as a search from
@@ -294,7 +330,9 @@ what browsers do - rather than libxml2. Detailed, test-backed notes live in
294
330
  therefore matches no type selector.
295
331
  * `Nokogiri::HTML5` is case-sensitive on HTML elements too, so `LI` does not
296
332
  match `<li>` there. `Makiri::XML`'s `#css` is case-sensitive, as XML names
297
- are.
333
+ are - an XHTML element's included, as in a browser's XML document - and so
334
+ are its attribute values, the HTML Standard's case-insensitive list of
335
+ attributes applying only to an HTML document.
298
336
 
299
337
  ## Serialization
300
338
 
@@ -310,6 +348,10 @@ what browsers do - rather than libxml2. Detailed, test-backed notes live in
310
348
  disabled (its children are elements, not raw text) and escaping is what makes
311
349
  that round-trip; `Nokogiri::HTML5` writes it literally and contradicts its own
312
350
  parser there.
351
+ * An Attr serializes to the empty string (`attr.to_s`, `#to_html`,
352
+ `NodeSet#to_s` over attributes), as DOM Parsing's algorithm and Firefox
353
+ have it, in HTML and XML. Nokogiri's `Attr#to_s` is the value (`"a"`) and
354
+ its `#to_html` the markup (`id="a"`); use `#value` for the value.
313
355
 
314
356
  ## Text input (mutation APIs)
315
357
 
data/NOTICE CHANGED
@@ -8,6 +8,57 @@ This product includes software developed by:
8
8
  Licensed under the Apache License, Version 2.0
9
9
  https://lexbor.com / https://github.com/lexbor/lexbor
10
10
 
11
+ The HTML tokenizer and tree builder under ext/makiri/rust/src/html/ and the
12
+ CSS syntax, selector and stylesheet parser under
13
+ ext/makiri/rust/src/selectors/ are Rust ports of Lexbor's, as are the HTML
14
+ CSS matcher under ext/makiri/rust/src/css_match/ and the tag and
15
+ attribute tables generated from Lexbor's. The extension links no Lexbor
16
+ code; Lexbor's LICENSE and NOTICE are kept under vendor/lexbor/ in the gem.
17
+
18
+ * encoding_rs (linked into the native extension)
19
+ Copyright Mozilla Foundation
20
+ Licensed under the Apache License, Version 2.0 (at the licensee's option,
21
+ also the MIT license)
22
+ https://github.com/hsivonen/encoding_rs
23
+
24
+ encoding_rs includes data derived from the data files supplied with the
25
+ WHATWG Encoding Standard, under this license:
26
+
27
+ Copyright © WHATWG (Apple, Google, Mozilla, Microsoft).
28
+
29
+ Redistribution and use in source and binary forms, with or without
30
+ modification, are permitted provided that the following conditions are
31
+ met:
32
+
33
+ 1. Redistributions of source code must retain the above copyright
34
+ notice, this list of conditions and the following disclaimer.
35
+
36
+ 2. Redistributions in binary form must reproduce the above copyright
37
+ notice, this list of conditions and the following disclaimer in the
38
+ documentation and/or other materials provided with the distribution.
39
+
40
+ 3. Neither the name of the copyright holder nor the names of its
41
+ contributors may be used to endorse or promote products derived from
42
+ this software without specific prior written permission.
43
+
44
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
45
+ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
46
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
47
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
48
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
49
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
50
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
51
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
52
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
53
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
54
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55
+
56
+ * chardetng (linked into the native extension)
57
+ Copyright Mozilla Foundation
58
+ Licensed under the Apache License, Version 2.0 (at the licensee's option,
59
+ also the MIT license)
60
+ https://github.com/hsivonen/chardetng
61
+
11
62
  The XPath 1.0 engine under ext/makiri/rust/src/xpath/ is an original
12
63
  implementation written for this project. No code is derived from libxml2 or
13
64
  libxslt.
data/README.md CHANGED
@@ -2,34 +2,38 @@
2
2
 
3
3
  Makiri is a Ruby library for parsing and querying HTML and XML documents.
4
4
 
5
- It uses [Lexbor](https://lexbor.com/) for HTML parsing and CSS selector matching, and includes a built-in native XPath 1.0 engine and XML 1.0 parser.
6
- Makiri does not depend on libxml2.
5
+ It parses HTML with a Rust port of [Lexbor](https://lexbor.com/)'s HTML5 parser, and has its own CSS selector matcher, XPath 1.0 engine and XML 1.0 parser.
6
+ Makiri does not depend on libxml2, and links no C library at all.
7
7
 
8
8
  > [!WARNING]
9
9
  > Status: early release. APIs and behavior may change before v1.0.
10
10
 
11
11
  ## What / Why
12
12
 
13
- Makiri uses Lexbor for HTML5 parsing and CSS selector support, and implements
14
- XPath 1.0 evaluation in its own native engine, with no libxml2 dependency.
15
-
16
- * HTML5 parsing via [Lexbor](https://lexbor.com)
17
- * Makiri uses Lexbor as the parsing backend and provides a Ruby-facing DOM/query layer.
18
- * CSS selector support via Lexbor
19
- * Supports Lexbor-backed standard CSS selector querying, including `:is`/`:where`/`:has`
13
+ Makiri is one Rust extension: an HTML5 parser ported from Lexbor, CSS
14
+ selectors, an XPath 1.0 engine and an XML 1.0 parser, with no libxml2
15
+ dependency.
16
+
17
+ * HTML5 parsing
18
+ * A Rust port of Lexbor's tokenizer and tree builder, into a compact DOM of
19
+ Makiri's own. It is held to the vendored Lexbor (which the gem does not
20
+ ship) and to the html5lib tests.
21
+ * CSS selectors
22
+ * Selectors 4, including `:is`/`:where`/`:not`/`:has` and `:nth-child(... of S)`,
23
+ matched by one engine for HTML and XML and checked against Chromium,
24
+ Firefox and WebKit's `querySelectorAll`.
20
25
  * Native XPath 1.0 engine
21
26
  * XPath is parsed and evaluated by Makiri's own engine, written from scratch.
22
27
  * Makiri does not depend on libxml2 for parsing, DOM representation, or XPath evaluation.
23
28
  * Native XML 1.0 parser
24
29
  * A strict, non-validating, fail-closed parser with its own node arena (not
25
- Lexbor's HTML DOM), queried through the same native XPath engine, with
30
+ the HTML DOM), queried through the same native XPath engine, with
26
31
  in-place tree edits (attributes, content, remove).
27
32
  * Conformance is held by the W3C XML Conformance Test Suite, an XPath
28
33
  differential, and property-based testing vs Nokogiri (see below).
29
34
  * Bounded, fail-closed execution
30
35
  * XPath evaluation is bounded by per-evaluation limits on work, memory, and recursion.
31
- * HTML parsing bounds the tree depth (`max_tree_depth:`, default 400) and the
32
- `<option>`s per `<select>` (10,000).
36
+ * HTML parsing bounds the tree depth (`max_tree_depth:`, default 400).
33
37
  * Ownership and borrowing are kept explicit across layers, with owned/borrowed
34
38
  string types and verified text at engine boundaries.
35
39
  * Programmatic invalid input, limit violations, allocation failures, and unsupported constructs
@@ -50,7 +54,7 @@ doc = Makiri::HTML(<<~HTML)
50
54
  </body></html>
51
55
  HTML
52
56
 
53
- # CSS selectors (Lexbor's selector parser, Makiri's own matcher)
57
+ # CSS selectors
54
58
  doc.css("a").map { |a| a["href"] } # => ["/a", "/b"]
55
59
  doc.at_css("p.lead").text # => "Hello"
56
60
 
@@ -64,9 +68,14 @@ link = doc.at_css("a")
64
68
  link["href"] # => "/a"
65
69
  link.parent.name # => "div"
66
70
 
67
- # Source location (reconstructed from the tokenizer, no Lexbor patches)
71
+ # Source location (the line of the element's start tag)
68
72
  doc.at_css("p").line # => 3
69
73
 
74
+ # Bytes are decoded as a browser decodes them: BOM, <meta charset>, else
75
+ # UTF-8 or a detected legacy encoding (or say which with encoding:)
76
+ Makiri::HTML(File.binread("legacy.html")).encoding # => "Shift_JIS"
77
+ Makiri::HTML(bytes, encoding: "euc-jp")
78
+
70
79
  # Nesting deeper than 400 elements raises Makiri::Error (Nokogiri's default);
71
80
  # max_tree_depth: raises the limit, and a negative value disables it
72
81
  Makiri::HTML(deep_html, max_tree_depth: 2000)
@@ -109,9 +118,10 @@ el = doc.at_xpath("//a:entry", ns)
109
118
  el.local_name # => "entry"
110
119
  el.namespace_uri # => "http://www.w3.org/2005/Atom"
111
120
 
112
- # CSS selectors work too (lowered to the native XPath engine): a bare type
113
- # selector binds to the document's default namespace, so this just works.
121
+ # CSS selectors work too, as in a browser: a bare type selector matches its
122
+ # name in any namespace, so this just works.
114
123
  doc.css("entry").length # => 2
124
+ doc.css("a|entry", ns).length # => 2 (a prefix the Hash binds)
115
125
  doc.css("feed > entry").map { |e| e.at_css("title").text } # => ["Hello", "World"]
116
126
 
117
127
  # Serialize back to XML
@@ -239,11 +249,14 @@ The HTML XPath and CSS suites are differentials against `Nokogiri::HTML5`
239
249
  HTML5, so the DOM is isomorphic and results are compared node-for-node. HTML
240
250
  parsing itself is checked against the WHATWG html5lib-tests corpus, and
241
251
  XPath-over-HTML semantics additionally against browsers via a WPT port.
252
+ HTML parsing and CSS selectors are also run in Chromium, Firefox and WebKit,
253
+ which are the reference where they and Nokogiri disagree.
242
254
  See also [`spec/conformance/README.md`](spec/conformance/README.md).
243
255
 
244
256
  | Suite | Input | Oracle | `rake` task |
245
257
  |---|---|---|---|
246
258
  | HTML parsing | HTML | WHATWG html5lib-tests (expected-tree corpus) | `conformance:html5` |
259
+ | HTML parsing | HTML | Chromium, Firefox, WebKit (Playwright) | `conformance:browsers` |
247
260
  | XPath 1.0 | HTML | `Nokogiri::HTML5` (libxml2 XPath) — differential | `conformance:xpath` |
248
261
  | XPath over HTML | HTML | browsers (WPT `domxpath`, hand-ported; runs under `rake spec`) | — |
249
262
  | CSS selectors | HTML | `Nokogiri::HTML5#css` — differential | `conformance:css` |
@@ -251,15 +264,19 @@ See also [`spec/conformance/README.md`](spec/conformance/README.md).
251
264
  | XPath 1.0 | XML | `Nokogiri::XML` — differential | `conformance:xpath_xml` |
252
265
  | Parsed tree (property-based) | XML | `Nokogiri::XML` — differential | `conformance:xml_pbt` |
253
266
  | CSS selectors | XML | `Nokogiri::XML` — differential | `conformance:css_xml` |
267
+ | CSS selectors | HTML, XML | Chromium, Firefox, WebKit `querySelectorAll` (Playwright) | `conformance:css_browsers` |
254
268
  | XML Builder | Ruby DSL | `Nokogiri::XML::Builder` — differential | `conformance:builder` |
255
269
 
256
270
  ## Requirements
257
271
 
258
- * CRuby 3.2 or newer.
259
- * A Rust toolchain (stable) with `cargo` - the extension is a Rust crate.
272
+ * CRuby 3.3 or newer.
273
+ * Rust 1.84 or newer with `cargo` - the extension is a Rust crate. (Binary
274
+ gems are published for the common platforms, which need no toolchain.)
260
275
  * libclang (clang's development library): rb-sys runs bindgen at build time and
261
276
  reads Ruby's headers through it.
262
- * CMake and a C toolchain, to build the vendored Lexbor static library.
277
+
278
+ Development also needs CMake and a C toolchain, to build the vendored Lexbor
279
+ that the Rust port is tested against (`rake lexbor`).
263
280
 
264
281
  ## Build (development)
265
282