makiri 0.16.0 → 0.17.0.rc1

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 (723) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +89 -0
  3. data/NOKOGIRI_DIFFERENCES.md +52 -48
  4. data/NOTICE +7 -0
  5. data/README.md +9 -6
  6. data/ext/makiri/rust/Cargo.toml +35 -8
  7. data/ext/makiri/rust/build.rs +37 -6
  8. data/ext/makiri/rust/extconf.rb +17 -193
  9. data/ext/makiri/rust/src/bridge/alloc.rs +115 -6
  10. data/ext/makiri/rust/src/bridge/doc.rs +51 -48
  11. data/ext/makiri/rust/src/bridge/dom.rs +107 -0
  12. data/ext/makiri/rust/src/bridge/fragment.rs +136 -108
  13. data/ext/makiri/rust/src/bridge/gvl.rs +1 -1
  14. data/ext/makiri/rust/src/bridge/html.rs +247 -266
  15. data/ext/makiri/rust/src/bridge/mod.rs +14 -8
  16. data/ext/makiri/rust/src/bridge/node_set.rs +25 -110
  17. data/ext/makiri/rust/src/bridge/raw.rs +199 -0
  18. data/ext/makiri/rust/src/bridge/ruby.rs +33 -10
  19. data/ext/makiri/rust/src/bridge/string.rs +206 -335
  20. data/ext/makiri/rust/src/bridge/typed.rs +133 -57
  21. data/ext/makiri/rust/src/bridge/wrapper.rs +210 -156
  22. data/ext/makiri/rust/src/bridge/xml.rs +20 -12
  23. data/ext/makiri/rust/src/bridge/xml_decode.rs +26 -34
  24. data/ext/makiri/rust/src/bridge/xpath/context_object.rs +3 -5
  25. data/ext/makiri/rust/src/bridge/xpath/handler.rs +7 -4
  26. data/ext/makiri/rust/src/bridge/xpath/mod.rs +10 -3
  27. data/ext/makiri/rust/src/compat.rs +440 -0
  28. data/ext/makiri/rust/src/conformance/dat.rs +150 -0
  29. data/ext/makiri/rust/src/conformance/json.rs +278 -0
  30. data/ext/makiri/rust/src/conformance/known.rs +67 -0
  31. data/ext/makiri/rust/src/conformance/mod.rs +55 -0
  32. data/ext/makiri/rust/src/conformance/res_gen.rs +607 -0
  33. data/ext/makiri/rust/src/conformance/tokens.rs +355 -0
  34. data/ext/makiri/rust/src/conformance/tree.rs +340 -0
  35. data/ext/makiri/rust/src/css/build.rs +11 -8
  36. data/ext/makiri/rust/src/css/lower.rs +87 -97
  37. data/ext/makiri/rust/src/css/mod.rs +22 -37
  38. data/ext/makiri/rust/src/{lexbor/css_match → css_match}/compile.rs +21 -17
  39. data/ext/makiri/rust/src/css_match/dom.rs +145 -0
  40. data/ext/makiri/rust/src/{lexbor/css_match → css_match}/mod.rs +144 -63
  41. data/ext/makiri/rust/src/css_match/ns.rs +131 -0
  42. data/ext/makiri/rust/src/{lexbor/css_match → css_match}/positions.rs +79 -12
  43. data/ext/makiri/rust/src/{lexbor/css_match → css_match}/query.rs +128 -92
  44. data/ext/makiri/rust/src/{lexbor/css_match → css_match}/scratch.rs +30 -14
  45. data/ext/makiri/rust/src/{lexbor/css_match → css_match}/simple.rs +103 -52
  46. data/ext/makiri/rust/src/{lexbor/css_match → css_match}/state.rs +157 -49
  47. data/ext/makiri/rust/src/{lexbor/css_match → css_match}/tree.rs +29 -24
  48. data/ext/makiri/rust/src/glue/css.rs +123 -4
  49. data/ext/makiri/rust/src/glue/html_doc.rs +8 -10
  50. data/ext/makiri/rust/src/glue/html_node/css.rs +42 -105
  51. data/ext/makiri/rust/src/glue/html_node/mutate.rs +124 -89
  52. data/ext/makiri/rust/src/glue/html_node/read.rs +64 -37
  53. data/ext/makiri/rust/src/glue/html_node/serialize.rs +28 -21
  54. data/ext/makiri/rust/src/glue/kwargs.rs +2 -2
  55. data/ext/makiri/rust/src/glue/node.rs +2 -2
  56. data/ext/makiri/rust/src/glue/node_set.rs +13 -5
  57. data/ext/makiri/rust/src/glue/query.rs +24 -3
  58. data/ext/makiri/rust/src/glue/stylesheet.rs +19 -24
  59. data/ext/makiri/rust/src/glue/xml_node/css.rs +69 -79
  60. data/ext/makiri/rust/src/glue/xml_node/mod.rs +0 -1
  61. data/ext/makiri/rust/src/glue/xml_node/mutate.rs +10 -0
  62. data/ext/makiri/rust/src/glue/xml_node/ns.rs +7 -7
  63. data/ext/makiri/rust/src/glue/xml_node/read.rs +16 -19
  64. data/ext/makiri/rust/src/glue/xml_node/serialize.rs +4 -3
  65. data/ext/makiri/rust/src/html/dom/build.rs +64 -0
  66. data/ext/makiri/rust/src/html/dom/compact.rs +79 -0
  67. data/ext/makiri/rust/src/html/dom/conformance.rs +116 -0
  68. data/ext/makiri/rust/src/html/dom/copy.rs +252 -0
  69. data/ext/makiri/rust/src/html/dom/cross_import.rs +405 -0
  70. data/ext/makiri/rust/src/html/dom/css.rs +185 -0
  71. data/ext/makiri/rust/src/html/dom/edit.rs +700 -0
  72. data/ext/makiri/rust/src/html/dom/ext_table.rs +85 -0
  73. data/ext/makiri/rust/src/html/dom/handle.rs +982 -0
  74. data/ext/makiri/rust/src/html/dom/index.rs +232 -0
  75. data/ext/makiri/rust/src/html/dom/mod.rs +1238 -0
  76. data/ext/makiri/rust/src/html/dom/parsed.rs +198 -0
  77. data/ext/makiri/rust/src/html/dom/serialize.rs +521 -0
  78. data/ext/makiri/rust/src/html/dom/store.rs +222 -0
  79. data/ext/makiri/rust/src/html/dom/tests.rs +150 -0
  80. data/ext/makiri/rust/src/html/dom/xpath.rs +250 -0
  81. data/ext/makiri/rust/src/html/mod.rs +15 -0
  82. data/ext/makiri/rust/src/html/names.rs +548 -0
  83. data/ext/makiri/rust/src/html/res/entities.rs +12101 -0
  84. data/ext/makiri/rust/src/html/res/mod.rs +78 -0
  85. data/ext/makiri/rust/src/html/res/names.rs +802 -0
  86. data/ext/makiri/rust/src/html/res/tree.rs +504 -0
  87. data/ext/makiri/rust/src/html/tokenizer/error.rs +113 -0
  88. data/ext/makiri/rust/src/html/tokenizer/mod.rs +900 -0
  89. data/ext/makiri/rust/src/html/tokenizer/state.rs +1283 -0
  90. data/ext/makiri/rust/src/html/tokenizer/state_comment.rs +216 -0
  91. data/ext/makiri/rust/src/html/tokenizer/state_doctype.rs +568 -0
  92. data/ext/makiri/rust/src/html/tokenizer/state_text.rs +611 -0
  93. data/ext/makiri/rust/src/html/tokenizer/tests.rs +232 -0
  94. data/ext/makiri/rust/src/html/tree/actions.rs +1093 -0
  95. data/ext/makiri/rust/src/html/tree/error.rs +102 -0
  96. data/ext/makiri/rust/src/html/tree/fragment.rs +175 -0
  97. data/ext/makiri/rust/src/html/tree/guard.rs +91 -0
  98. data/ext/makiri/rust/src/html/tree/mod.rs +618 -0
  99. data/ext/makiri/rust/src/html/tree/modes/after_after_body.rs +43 -0
  100. data/ext/makiri/rust/src/html/tree/modes/after_after_frameset.rs +56 -0
  101. data/ext/makiri/rust/src/html/tree/modes/after_body.rs +47 -0
  102. data/ext/makiri/rust/src/html/tree/modes/after_frameset.rs +42 -0
  103. data/ext/makiri/rust/src/html/tree/modes/after_head.rs +107 -0
  104. data/ext/makiri/rust/src/html/tree/modes/before_head.rs +70 -0
  105. data/ext/makiri/rust/src/html/tree/modes/before_html.rs +85 -0
  106. data/ext/makiri/rust/src/html/tree/modes/foreign_content.rs +257 -0
  107. data/ext/makiri/rust/src/html/tree/modes/in_body.rs +1023 -0
  108. data/ext/makiri/rust/src/html/tree/modes/in_caption.rs +59 -0
  109. data/ext/makiri/rust/src/html/tree/modes/in_cell.rs +77 -0
  110. data/ext/makiri/rust/src/html/tree/modes/in_column_group.rs +94 -0
  111. data/ext/makiri/rust/src/html/tree/modes/in_frameset.rs +83 -0
  112. data/ext/makiri/rust/src/html/tree/modes/in_head.rs +139 -0
  113. data/ext/makiri/rust/src/html/tree/modes/in_head_noscript.rs +67 -0
  114. data/ext/makiri/rust/src/html/tree/modes/in_row.rs +87 -0
  115. data/ext/makiri/rust/src/html/tree/modes/in_table.rs +234 -0
  116. data/ext/makiri/rust/src/html/tree/modes/in_table_body.rs +104 -0
  117. data/ext/makiri/rust/src/html/tree/modes/in_table_text.rs +77 -0
  118. data/ext/makiri/rust/src/html/tree/modes/in_template.rs +66 -0
  119. data/ext/makiri/rust/src/html/tree/modes/initial.rs +185 -0
  120. data/ext/makiri/rust/src/html/tree/modes/mod.rs +25 -0
  121. data/ext/makiri/rust/src/html/tree/modes/text.rs +27 -0
  122. data/ext/makiri/rust/src/html/tree/parse.rs +183 -0
  123. data/ext/makiri/rust/src/html/tree/select.rs +701 -0
  124. data/ext/makiri/rust/src/html/tree/stacks.rs +462 -0
  125. data/ext/makiri/rust/src/html/tree/stamp.rs +113 -0
  126. data/ext/makiri/rust/src/html_dom.rs +39 -0
  127. data/ext/makiri/rust/src/init.rs +1 -4
  128. data/ext/makiri/rust/src/lexbor/abi.rs +0 -12
  129. data/ext/makiri/rust/src/lexbor/adapter/arena_copy.rs +171 -0
  130. data/ext/makiri/rust/src/lexbor/adapter/html/build.rs +19 -8
  131. data/ext/makiri/rust/src/lexbor/adapter/html/doc_mut.rs +229 -0
  132. data/ext/makiri/rust/src/lexbor/adapter/html/mod.rs +34 -95
  133. data/ext/makiri/rust/src/lexbor/adapter/html/mutate.rs +23 -7
  134. data/ext/makiri/rust/src/lexbor/adapter/mod.rs +2 -0
  135. data/ext/makiri/rust/src/lexbor/adapter/post_parse.rs +12 -75
  136. data/ext/makiri/rust/src/lexbor/adapter/source_loc.rs +2 -77
  137. data/ext/makiri/rust/src/lexbor/adapter/tree_guard.rs +17 -187
  138. data/ext/makiri/rust/src/lexbor/arena_fragment.rs +266 -0
  139. data/ext/makiri/rust/src/lexbor/arena_parse.rs +8 -0
  140. data/ext/makiri/rust/src/lexbor/arena_tests.rs +1213 -0
  141. data/ext/makiri/rust/src/lexbor/conformance_tests.rs +1196 -0
  142. data/ext/makiri/rust/src/lexbor/css_engine.rs +19 -25
  143. data/ext/makiri/rust/src/lexbor/css_parser.rs +19 -19
  144. data/ext/makiri/rust/src/lexbor/fragment.rs +75 -46
  145. data/ext/makiri/rust/src/lexbor/mod.rs +80 -15
  146. data/ext/makiri/rust/src/lexbor/res_tests.rs +448 -0
  147. data/ext/makiri/rust/src/lexbor/selector_cache.rs +111 -236
  148. data/ext/makiri/rust/src/lexbor/selector_diff.rs +157 -0
  149. data/ext/makiri/rust/src/lexbor/selector_port_tests.rs +1122 -0
  150. data/ext/makiri/rust/src/lexbor/selector_text.rs +1 -1
  151. data/ext/makiri/rust/src/lexbor/selectors.rs +1 -1
  152. data/ext/makiri/rust/src/lexbor/serialize.rs +2 -4
  153. data/ext/makiri/rust/src/lexbor/stylesheet.rs +211 -312
  154. data/ext/makiri/rust/src/lexbor/stylesheet_diff.rs +340 -0
  155. data/ext/makiri/rust/src/lexbor/tests.rs +272 -187
  156. data/ext/makiri/rust/src/lexbor/tree_diff.rs +494 -0
  157. data/ext/makiri/rust/src/lexbor/tree_port_tests.rs +914 -0
  158. data/ext/makiri/rust/src/lexbor/twin.rs +71 -0
  159. data/ext/makiri/rust/src/lexbor/xpath.rs +7 -1
  160. data/ext/makiri/rust/src/lexbor/xpath_diff.rs +507 -0
  161. data/ext/makiri/rust/src/lib.rs +38 -5
  162. data/ext/makiri/rust/src/selectors/ast.rs +473 -0
  163. data/ext/makiri/rust/src/selectors/mod.rs +31 -0
  164. data/ext/makiri/rust/src/selectors/parser/syntax.rs +1101 -0
  165. data/ext/makiri/rust/src/selectors/parser.rs +2450 -0
  166. data/ext/makiri/rust/src/selectors/pseudo.rs +404 -0
  167. data/ext/makiri/rust/src/selectors/rules.rs +123 -0
  168. data/ext/makiri/rust/src/selectors/specificity.rs +88 -0
  169. data/ext/makiri/rust/src/selectors/strtod.rs +351 -0
  170. data/ext/makiri/rust/src/selectors/token.rs +72 -0
  171. data/ext/makiri/rust/src/selectors/tokenizer.rs +1456 -0
  172. data/ext/makiri/rust/src/source_lines.rs +85 -0
  173. data/ext/makiri/rust/src/token.rs +15 -0
  174. data/ext/makiri/rust/src/xml/arena.rs +1 -0
  175. data/ext/makiri/rust/src/xml/css.rs +314 -0
  176. data/ext/makiri/rust/src/xml/css_tests.rs +441 -0
  177. data/ext/makiri/rust/src/xml/index.rs +52 -3
  178. data/ext/makiri/rust/src/xml/mod.rs +3 -0
  179. data/ext/makiri/rust/src/xml/model.rs +2 -0
  180. data/ext/makiri/rust/src/xml/xpath.rs +6 -0
  181. data/ext/makiri/rust/src/xpath/abi.rs +1 -0
  182. data/ext/makiri/rust/src/xpath/dom.rs +14 -3
  183. data/ext/makiri/rust/src/xpath/eval.rs +2 -0
  184. data/ext/makiri/rust/src/xpath/funcs/css_hooks.rs +208 -0
  185. data/ext/makiri/rust/src/xpath/funcs/ext.rs +2 -204
  186. data/ext/makiri/rust/src/xpath/funcs/mod.rs +42 -14
  187. data/ext/makiri/rust/src/xpath/step_index.rs +4 -2
  188. data/ext/makiri/rust/src/xpath/tests.rs +28 -18
  189. data/lib/makiri/version.rb +1 -1
  190. data/lib/makiri/xml/node_methods.rb +14 -30
  191. metadata +116 -545
  192. data/.github/workflows/ci.yml +0 -204
  193. data/.github/workflows/conformance.yml +0 -135
  194. data/.github/workflows/css-match.yml +0 -217
  195. data/.github/workflows/libfuzzer.yml +0 -116
  196. data/.github/workflows/release.yml +0 -273
  197. data/.github/workflows/security.yml +0 -305
  198. data/.github/workflows/valgrind.yml +0 -187
  199. data/.github/workflows/verify.yml +0 -71
  200. data/.gitmodules +0 -3
  201. data/Rakefile +0 -946
  202. data/ext/makiri/rust/clippy.toml +0 -67
  203. data/ext/makiri/rust/fuzz/Cargo.lock +0 -303
  204. data/ext/makiri/rust/fuzz/Cargo.toml +0 -79
  205. data/ext/makiri/rust/fuzz/build.rs +0 -7
  206. data/ext/makiri/rust/fuzz/css.dict +0 -77
  207. data/ext/makiri/rust/fuzz/fuzz_targets/common.rs +0 -80
  208. data/ext/makiri/rust/fuzz/fuzz_targets/css.rs +0 -79
  209. data/ext/makiri/rust/fuzz/fuzz_targets/html.rs +0 -24
  210. data/ext/makiri/rust/fuzz/fuzz_targets/html_css.rs +0 -104
  211. data/ext/makiri/rust/fuzz/fuzz_targets/html_css_diff.rs +0 -300
  212. data/ext/makiri/rust/fuzz/fuzz_targets/html_xpath.rs +0 -80
  213. data/ext/makiri/rust/fuzz/fuzz_targets/xml.rs +0 -17
  214. data/ext/makiri/rust/fuzz/fuzz_targets/xml_xpath.rs +0 -64
  215. data/ext/makiri/rust/fuzz/fuzz_targets/xpath.rs +0 -58
  216. data/ext/makiri/rust/src/glue/xml_node/strings.rs +0 -25
  217. data/ext/makiri/rust/src/lexbor/memory.rs +0 -78
  218. data/ext/makiri/rust/tests/alloc_inject_map_insert.rs +0 -47
  219. data/script/api_manifest.rb +0 -173
  220. data/script/build_native_gem.rb +0 -53
  221. data/script/check_alloc_failures.rb +0 -815
  222. data/script/check_leaks.rb +0 -64
  223. data/script/check_unsafe_boundaries.rb +0 -782
  224. data/script/leaks_harness.rb +0 -90
  225. data/suppressions/ruby.supp +0 -194
  226. data/tools/pe_exports.rb +0 -124
  227. data/vendor/lexbor/.travis.yml +0 -50
  228. data/vendor/lexbor/CHANGELOG.md +0 -285
  229. data/vendor/lexbor/CMakeLists.txt +0 -481
  230. data/vendor/lexbor/INSTALL.md +0 -74
  231. data/vendor/lexbor/README.md +0 -292
  232. data/vendor/lexbor/SECURITY.md +0 -18
  233. data/vendor/lexbor/config.cmake +0 -983
  234. data/vendor/lexbor/feature.cmake +0 -204
  235. data/vendor/lexbor/lexbor-config.cmake.in +0 -8
  236. data/vendor/lexbor/lexbor.pc.in +0 -12
  237. data/vendor/lexbor/pvs_studio.sh +0 -18
  238. data/vendor/lexbor/single.pl +0 -2490
  239. data/vendor/lexbor/source/lexbor/core/array.c +0 -208
  240. data/vendor/lexbor/source/lexbor/core/array.h +0 -100
  241. data/vendor/lexbor/source/lexbor/core/array_obj.c +0 -216
  242. data/vendor/lexbor/source/lexbor/core/array_obj.h +0 -134
  243. data/vendor/lexbor/source/lexbor/core/avl.c +0 -525
  244. data/vendor/lexbor/source/lexbor/core/avl.h +0 -92
  245. data/vendor/lexbor/source/lexbor/core/base.h +0 -108
  246. data/vendor/lexbor/source/lexbor/core/bst.c +0 -471
  247. data/vendor/lexbor/source/lexbor/core/bst.h +0 -108
  248. data/vendor/lexbor/source/lexbor/core/bst_map.c +0 -238
  249. data/vendor/lexbor/source/lexbor/core/bst_map.h +0 -87
  250. data/vendor/lexbor/source/lexbor/core/config.cmake +0 -20
  251. data/vendor/lexbor/source/lexbor/core/conv.c +0 -356
  252. data/vendor/lexbor/source/lexbor/core/conv.h +0 -62
  253. data/vendor/lexbor/source/lexbor/core/core.h +0 -35
  254. data/vendor/lexbor/source/lexbor/core/def.h +0 -59
  255. data/vendor/lexbor/source/lexbor/core/diyfp.c +0 -181
  256. data/vendor/lexbor/source/lexbor/core/diyfp.h +0 -285
  257. data/vendor/lexbor/source/lexbor/core/dobject.c +0 -187
  258. data/vendor/lexbor/source/lexbor/core/dobject.h +0 -88
  259. data/vendor/lexbor/source/lexbor/core/dtoa.c +0 -401
  260. data/vendor/lexbor/source/lexbor/core/dtoa.h +0 -54
  261. data/vendor/lexbor/source/lexbor/core/fs.h +0 -60
  262. data/vendor/lexbor/source/lexbor/core/hash.c +0 -477
  263. data/vendor/lexbor/source/lexbor/core/hash.h +0 -218
  264. data/vendor/lexbor/source/lexbor/core/in.c +0 -266
  265. data/vendor/lexbor/source/lexbor/core/in.h +0 -172
  266. data/vendor/lexbor/source/lexbor/core/lexbor.h +0 -43
  267. data/vendor/lexbor/source/lexbor/core/mem.c +0 -228
  268. data/vendor/lexbor/source/lexbor/core/mem.h +0 -141
  269. data/vendor/lexbor/source/lexbor/core/mraw.c +0 -421
  270. data/vendor/lexbor/source/lexbor/core/mraw.h +0 -114
  271. data/vendor/lexbor/source/lexbor/core/perf.h +0 -40
  272. data/vendor/lexbor/source/lexbor/core/plog.c +0 -73
  273. data/vendor/lexbor/source/lexbor/core/plog.h +0 -102
  274. data/vendor/lexbor/source/lexbor/core/print.c +0 -168
  275. data/vendor/lexbor/source/lexbor/core/print.h +0 -39
  276. data/vendor/lexbor/source/lexbor/core/sbst.h +0 -59
  277. data/vendor/lexbor/source/lexbor/core/serialize.c +0 -27
  278. data/vendor/lexbor/source/lexbor/core/serialize.h +0 -32
  279. data/vendor/lexbor/source/lexbor/core/shs.c +0 -118
  280. data/vendor/lexbor/source/lexbor/core/shs.h +0 -82
  281. data/vendor/lexbor/source/lexbor/core/str.c +0 -667
  282. data/vendor/lexbor/source/lexbor/core/str.h +0 -257
  283. data/vendor/lexbor/source/lexbor/core/str_res.h +0 -360
  284. data/vendor/lexbor/source/lexbor/core/strtod.c +0 -348
  285. data/vendor/lexbor/source/lexbor/core/strtod.h +0 -54
  286. data/vendor/lexbor/source/lexbor/core/swar.h +0 -97
  287. data/vendor/lexbor/source/lexbor/core/types.h +0 -39
  288. data/vendor/lexbor/source/lexbor/core/utils.c +0 -43
  289. data/vendor/lexbor/source/lexbor/core/utils.h +0 -36
  290. data/vendor/lexbor/source/lexbor/css/at_rule/const.h +0 -32
  291. data/vendor/lexbor/source/lexbor/css/at_rule/res.h +0 -49
  292. data/vendor/lexbor/source/lexbor/css/at_rule/state.c +0 -374
  293. data/vendor/lexbor/source/lexbor/css/at_rule/state.h +0 -128
  294. data/vendor/lexbor/source/lexbor/css/at_rule/types.h +0 -60
  295. data/vendor/lexbor/source/lexbor/css/at_rule.c +0 -449
  296. data/vendor/lexbor/source/lexbor/css/at_rule.h +0 -152
  297. data/vendor/lexbor/source/lexbor/css/base.h +0 -136
  298. data/vendor/lexbor/source/lexbor/css/blank.c +0 -389
  299. data/vendor/lexbor/source/lexbor/css/blank.h +0 -38
  300. data/vendor/lexbor/source/lexbor/css/config.cmake +0 -2
  301. data/vendor/lexbor/source/lexbor/css/css.c +0 -254
  302. data/vendor/lexbor/source/lexbor/css/css.h +0 -52
  303. data/vendor/lexbor/source/lexbor/css/declaration.c +0 -86
  304. data/vendor/lexbor/source/lexbor/css/declaration.h +0 -33
  305. data/vendor/lexbor/source/lexbor/css/log.c +0 -335
  306. data/vendor/lexbor/source/lexbor/css/log.h +0 -103
  307. data/vendor/lexbor/source/lexbor/css/parser.c +0 -563
  308. data/vendor/lexbor/source/lexbor/css/parser.h +0 -756
  309. data/vendor/lexbor/source/lexbor/css/property/const.h +0 -1180
  310. data/vendor/lexbor/source/lexbor/css/property/res.h +0 -524
  311. data/vendor/lexbor/source/lexbor/css/property/state.c +0 -5343
  312. data/vendor/lexbor/source/lexbor/css/property/state.h +0 -330
  313. data/vendor/lexbor/source/lexbor/css/property/types.h +0 -21
  314. data/vendor/lexbor/source/lexbor/css/property.c +0 -3171
  315. data/vendor/lexbor/source/lexbor/css/property.h +0 -1754
  316. data/vendor/lexbor/source/lexbor/css/rule.c +0 -598
  317. data/vendor/lexbor/source/lexbor/css/rule.h +0 -453
  318. data/vendor/lexbor/source/lexbor/css/selectors/base.h +0 -47
  319. data/vendor/lexbor/source/lexbor/css/selectors/pseudo.c +0 -102
  320. data/vendor/lexbor/source/lexbor/css/selectors/pseudo.h +0 -70
  321. data/vendor/lexbor/source/lexbor/css/selectors/pseudo_const.h +0 -110
  322. data/vendor/lexbor/source/lexbor/css/selectors/pseudo_res.h +0 -325
  323. data/vendor/lexbor/source/lexbor/css/selectors/pseudo_state.c +0 -429
  324. data/vendor/lexbor/source/lexbor/css/selectors/pseudo_state.h +0 -89
  325. data/vendor/lexbor/source/lexbor/css/selectors/selector.c +0 -1002
  326. data/vendor/lexbor/source/lexbor/css/selectors/selector.h +0 -283
  327. data/vendor/lexbor/source/lexbor/css/selectors/selectors.c +0 -326
  328. data/vendor/lexbor/source/lexbor/css/selectors/selectors.h +0 -123
  329. data/vendor/lexbor/source/lexbor/css/selectors/state.c +0 -2085
  330. data/vendor/lexbor/source/lexbor/css/selectors/state.h +0 -86
  331. data/vendor/lexbor/source/lexbor/css/state.c +0 -676
  332. data/vendor/lexbor/source/lexbor/css/state.h +0 -59
  333. data/vendor/lexbor/source/lexbor/css/stylesheet.c +0 -111
  334. data/vendor/lexbor/source/lexbor/css/stylesheet.h +0 -90
  335. data/vendor/lexbor/source/lexbor/css/syntax/anb.c +0 -486
  336. data/vendor/lexbor/source/lexbor/css/syntax/anb.h +0 -46
  337. data/vendor/lexbor/source/lexbor/css/syntax/base.h +0 -33
  338. data/vendor/lexbor/source/lexbor/css/syntax/parser.c +0 -2251
  339. data/vendor/lexbor/source/lexbor/css/syntax/parser.h +0 -95
  340. data/vendor/lexbor/source/lexbor/css/syntax/res.h +0 -42
  341. data/vendor/lexbor/source/lexbor/css/syntax/state.c +0 -1852
  342. data/vendor/lexbor/source/lexbor/css/syntax/state.h +0 -128
  343. data/vendor/lexbor/source/lexbor/css/syntax/state_res.h +0 -273
  344. data/vendor/lexbor/source/lexbor/css/syntax/syntax.c +0 -535
  345. data/vendor/lexbor/source/lexbor/css/syntax/syntax.h +0 -255
  346. data/vendor/lexbor/source/lexbor/css/syntax/token.c +0 -674
  347. data/vendor/lexbor/source/lexbor/css/syntax/token.h +0 -333
  348. data/vendor/lexbor/source/lexbor/css/syntax/token_res.h +0 -82
  349. data/vendor/lexbor/source/lexbor/css/syntax/tokenizer/error.c +0 -30
  350. data/vendor/lexbor/source/lexbor/css/syntax/tokenizer/error.h +0 -60
  351. data/vendor/lexbor/source/lexbor/css/syntax/tokenizer.c +0 -397
  352. data/vendor/lexbor/source/lexbor/css/syntax/tokenizer.h +0 -123
  353. data/vendor/lexbor/source/lexbor/css/unit/const.h +0 -98
  354. data/vendor/lexbor/source/lexbor/css/unit/res.h +0 -294
  355. data/vendor/lexbor/source/lexbor/css/unit.c +0 -113
  356. data/vendor/lexbor/source/lexbor/css/unit.h +0 -46
  357. data/vendor/lexbor/source/lexbor/css/value/const.h +0 -397
  358. data/vendor/lexbor/source/lexbor/css/value/res.h +0 -775
  359. data/vendor/lexbor/source/lexbor/css/value.c +0 -678
  360. data/vendor/lexbor/source/lexbor/css/value.h +0 -290
  361. data/vendor/lexbor/source/lexbor/dom/base.h +0 -32
  362. data/vendor/lexbor/source/lexbor/dom/collection.c +0 -97
  363. data/vendor/lexbor/source/lexbor/dom/collection.h +0 -112
  364. data/vendor/lexbor/source/lexbor/dom/config.cmake +0 -3
  365. data/vendor/lexbor/source/lexbor/dom/dom.h +0 -29
  366. data/vendor/lexbor/source/lexbor/dom/exception.c +0 -372
  367. data/vendor/lexbor/source/lexbor/dom/exception.h +0 -99
  368. data/vendor/lexbor/source/lexbor/dom/interface.c +0 -110
  369. data/vendor/lexbor/source/lexbor/dom/interface.h +0 -86
  370. data/vendor/lexbor/source/lexbor/dom/interfaces/attr.c +0 -534
  371. data/vendor/lexbor/source/lexbor/dom/interfaces/attr.h +0 -141
  372. data/vendor/lexbor/source/lexbor/dom/interfaces/attr_const.h +0 -99
  373. data/vendor/lexbor/source/lexbor/dom/interfaces/attr_res.h +0 -263
  374. data/vendor/lexbor/source/lexbor/dom/interfaces/cdata_section.c +0 -55
  375. data/vendor/lexbor/source/lexbor/dom/interfaces/cdata_section.h +0 -38
  376. data/vendor/lexbor/source/lexbor/dom/interfaces/character_data.c +0 -116
  377. data/vendor/lexbor/source/lexbor/dom/interfaces/character_data.h +0 -51
  378. data/vendor/lexbor/source/lexbor/dom/interfaces/comment.c +0 -64
  379. data/vendor/lexbor/source/lexbor/dom/interfaces/comment.h +0 -42
  380. data/vendor/lexbor/source/lexbor/dom/interfaces/document.c +0 -593
  381. data/vendor/lexbor/source/lexbor/dom/interfaces/document.h +0 -336
  382. data/vendor/lexbor/source/lexbor/dom/interfaces/document_fragment.c +0 -36
  383. data/vendor/lexbor/source/lexbor/dom/interfaces/document_fragment.h +0 -36
  384. data/vendor/lexbor/source/lexbor/dom/interfaces/document_type.c +0 -232
  385. data/vendor/lexbor/source/lexbor/dom/interfaces/document_type.h +0 -135
  386. data/vendor/lexbor/source/lexbor/dom/interfaces/element.c +0 -896
  387. data/vendor/lexbor/source/lexbor/dom/interfaces/element.h +0 -361
  388. data/vendor/lexbor/source/lexbor/dom/interfaces/event_target.c +0 -32
  389. data/vendor/lexbor/source/lexbor/dom/interfaces/event_target.h +0 -34
  390. data/vendor/lexbor/source/lexbor/dom/interfaces/node.c +0 -1866
  391. data/vendor/lexbor/source/lexbor/dom/interfaces/node.h +0 -396
  392. data/vendor/lexbor/source/lexbor/dom/interfaces/processing_instruction.c +0 -92
  393. data/vendor/lexbor/source/lexbor/dom/interfaces/processing_instruction.h +0 -66
  394. data/vendor/lexbor/source/lexbor/dom/interfaces/shadow_root.c +0 -36
  395. data/vendor/lexbor/source/lexbor/dom/interfaces/shadow_root.h +0 -44
  396. data/vendor/lexbor/source/lexbor/dom/interfaces/text.c +0 -63
  397. data/vendor/lexbor/source/lexbor/dom/interfaces/text.h +0 -42
  398. data/vendor/lexbor/source/lexbor/encoding/base.h +0 -218
  399. data/vendor/lexbor/source/lexbor/encoding/config.cmake +0 -12
  400. data/vendor/lexbor/source/lexbor/encoding/const.h +0 -65
  401. data/vendor/lexbor/source/lexbor/encoding/decode.c +0 -3383
  402. data/vendor/lexbor/source/lexbor/encoding/decode.h +0 -381
  403. data/vendor/lexbor/source/lexbor/encoding/encode.c +0 -2054
  404. data/vendor/lexbor/source/lexbor/encoding/encode.h +0 -380
  405. data/vendor/lexbor/source/lexbor/encoding/encoding.c +0 -413
  406. data/vendor/lexbor/source/lexbor/encoding/encoding.h +0 -462
  407. data/vendor/lexbor/source/lexbor/encoding/multi.h +0 -63
  408. data/vendor/lexbor/source/lexbor/encoding/multi_res.c +0 -298309
  409. data/vendor/lexbor/source/lexbor/encoding/range.h +0 -35
  410. data/vendor/lexbor/source/lexbor/encoding/range_res.c +0 -71
  411. data/vendor/lexbor/source/lexbor/encoding/res.c +0 -222
  412. data/vendor/lexbor/source/lexbor/encoding/res.h +0 -34
  413. data/vendor/lexbor/source/lexbor/encoding/single.h +0 -117
  414. data/vendor/lexbor/source/lexbor/encoding/single_res.c +0 -13748
  415. data/vendor/lexbor/source/lexbor/engine/base.h +0 -30
  416. data/vendor/lexbor/source/lexbor/engine/config.cmake +0 -2
  417. data/vendor/lexbor/source/lexbor/engine/engine.c +0 -294
  418. data/vendor/lexbor/source/lexbor/engine/engine.h +0 -60
  419. data/vendor/lexbor/source/lexbor/html/attribute_steps.c +0 -159
  420. data/vendor/lexbor/source/lexbor/html/attribute_steps.h +0 -49
  421. data/vendor/lexbor/source/lexbor/html/attribute_steps_res.h +0 -427
  422. data/vendor/lexbor/source/lexbor/html/base.h +0 -44
  423. data/vendor/lexbor/source/lexbor/html/common.c +0 -115
  424. data/vendor/lexbor/source/lexbor/html/common.h +0 -32
  425. data/vendor/lexbor/source/lexbor/html/config.cmake +0 -3
  426. data/vendor/lexbor/source/lexbor/html/element_steps.c +0 -220
  427. data/vendor/lexbor/source/lexbor/html/element_steps.h +0 -47
  428. data/vendor/lexbor/source/lexbor/html/element_steps_res.h +0 -427
  429. data/vendor/lexbor/source/lexbor/html/encoding.c +0 -679
  430. data/vendor/lexbor/source/lexbor/html/encoding.h +0 -243
  431. data/vendor/lexbor/source/lexbor/html/html.h +0 -109
  432. data/vendor/lexbor/source/lexbor/html/interface.c +0 -168
  433. data/vendor/lexbor/source/lexbor/html/interface.h +0 -189
  434. data/vendor/lexbor/source/lexbor/html/interface_res.h +0 -5456
  435. data/vendor/lexbor/source/lexbor/html/interfaces/anchor_element.c +0 -35
  436. data/vendor/lexbor/source/lexbor/html/interfaces/anchor_element.h +0 -34
  437. data/vendor/lexbor/source/lexbor/html/interfaces/area_element.c +0 -35
  438. data/vendor/lexbor/source/lexbor/html/interfaces/area_element.h +0 -34
  439. data/vendor/lexbor/source/lexbor/html/interfaces/audio_element.c +0 -35
  440. data/vendor/lexbor/source/lexbor/html/interfaces/audio_element.h +0 -34
  441. data/vendor/lexbor/source/lexbor/html/interfaces/base_element.c +0 -35
  442. data/vendor/lexbor/source/lexbor/html/interfaces/base_element.h +0 -34
  443. data/vendor/lexbor/source/lexbor/html/interfaces/body_element.c +0 -35
  444. data/vendor/lexbor/source/lexbor/html/interfaces/body_element.h +0 -34
  445. data/vendor/lexbor/source/lexbor/html/interfaces/br_element.c +0 -35
  446. data/vendor/lexbor/source/lexbor/html/interfaces/br_element.h +0 -34
  447. data/vendor/lexbor/source/lexbor/html/interfaces/button_element.c +0 -35
  448. data/vendor/lexbor/source/lexbor/html/interfaces/button_element.h +0 -34
  449. data/vendor/lexbor/source/lexbor/html/interfaces/canvas_element.c +0 -35
  450. data/vendor/lexbor/source/lexbor/html/interfaces/canvas_element.h +0 -34
  451. data/vendor/lexbor/source/lexbor/html/interfaces/d_list_element.c +0 -35
  452. data/vendor/lexbor/source/lexbor/html/interfaces/d_list_element.h +0 -34
  453. data/vendor/lexbor/source/lexbor/html/interfaces/data_element.c +0 -35
  454. data/vendor/lexbor/source/lexbor/html/interfaces/data_element.h +0 -34
  455. data/vendor/lexbor/source/lexbor/html/interfaces/data_list_element.c +0 -35
  456. data/vendor/lexbor/source/lexbor/html/interfaces/data_list_element.h +0 -34
  457. data/vendor/lexbor/source/lexbor/html/interfaces/details_element.c +0 -35
  458. data/vendor/lexbor/source/lexbor/html/interfaces/details_element.h +0 -34
  459. data/vendor/lexbor/source/lexbor/html/interfaces/dialog_element.c +0 -35
  460. data/vendor/lexbor/source/lexbor/html/interfaces/dialog_element.h +0 -34
  461. data/vendor/lexbor/source/lexbor/html/interfaces/directory_element.c +0 -35
  462. data/vendor/lexbor/source/lexbor/html/interfaces/directory_element.h +0 -34
  463. data/vendor/lexbor/source/lexbor/html/interfaces/div_element.c +0 -35
  464. data/vendor/lexbor/source/lexbor/html/interfaces/div_element.h +0 -34
  465. data/vendor/lexbor/source/lexbor/html/interfaces/document.c +0 -512
  466. data/vendor/lexbor/source/lexbor/html/interfaces/document.h +0 -313
  467. data/vendor/lexbor/source/lexbor/html/interfaces/element.c +0 -145
  468. data/vendor/lexbor/source/lexbor/html/interfaces/element.h +0 -137
  469. data/vendor/lexbor/source/lexbor/html/interfaces/embed_element.c +0 -35
  470. data/vendor/lexbor/source/lexbor/html/interfaces/embed_element.h +0 -34
  471. data/vendor/lexbor/source/lexbor/html/interfaces/field_set_element.c +0 -35
  472. data/vendor/lexbor/source/lexbor/html/interfaces/field_set_element.h +0 -34
  473. data/vendor/lexbor/source/lexbor/html/interfaces/font_element.c +0 -35
  474. data/vendor/lexbor/source/lexbor/html/interfaces/font_element.h +0 -34
  475. data/vendor/lexbor/source/lexbor/html/interfaces/form_element.c +0 -35
  476. data/vendor/lexbor/source/lexbor/html/interfaces/form_element.h +0 -34
  477. data/vendor/lexbor/source/lexbor/html/interfaces/frame_element.c +0 -35
  478. data/vendor/lexbor/source/lexbor/html/interfaces/frame_element.h +0 -34
  479. data/vendor/lexbor/source/lexbor/html/interfaces/frame_set_element.c +0 -35
  480. data/vendor/lexbor/source/lexbor/html/interfaces/frame_set_element.h +0 -34
  481. data/vendor/lexbor/source/lexbor/html/interfaces/head_element.c +0 -35
  482. data/vendor/lexbor/source/lexbor/html/interfaces/head_element.h +0 -34
  483. data/vendor/lexbor/source/lexbor/html/interfaces/heading_element.c +0 -35
  484. data/vendor/lexbor/source/lexbor/html/interfaces/heading_element.h +0 -34
  485. data/vendor/lexbor/source/lexbor/html/interfaces/hr_element.c +0 -35
  486. data/vendor/lexbor/source/lexbor/html/interfaces/hr_element.h +0 -34
  487. data/vendor/lexbor/source/lexbor/html/interfaces/html_element.c +0 -35
  488. data/vendor/lexbor/source/lexbor/html/interfaces/html_element.h +0 -34
  489. data/vendor/lexbor/source/lexbor/html/interfaces/iframe_element.c +0 -35
  490. data/vendor/lexbor/source/lexbor/html/interfaces/iframe_element.h +0 -34
  491. data/vendor/lexbor/source/lexbor/html/interfaces/image_element.c +0 -35
  492. data/vendor/lexbor/source/lexbor/html/interfaces/image_element.h +0 -34
  493. data/vendor/lexbor/source/lexbor/html/interfaces/input_element.c +0 -35
  494. data/vendor/lexbor/source/lexbor/html/interfaces/input_element.h +0 -34
  495. data/vendor/lexbor/source/lexbor/html/interfaces/label_element.c +0 -35
  496. data/vendor/lexbor/source/lexbor/html/interfaces/label_element.h +0 -34
  497. data/vendor/lexbor/source/lexbor/html/interfaces/legend_element.c +0 -35
  498. data/vendor/lexbor/source/lexbor/html/interfaces/legend_element.h +0 -34
  499. data/vendor/lexbor/source/lexbor/html/interfaces/li_element.c +0 -35
  500. data/vendor/lexbor/source/lexbor/html/interfaces/li_element.h +0 -34
  501. data/vendor/lexbor/source/lexbor/html/interfaces/link_element.c +0 -35
  502. data/vendor/lexbor/source/lexbor/html/interfaces/link_element.h +0 -34
  503. data/vendor/lexbor/source/lexbor/html/interfaces/map_element.c +0 -35
  504. data/vendor/lexbor/source/lexbor/html/interfaces/map_element.h +0 -34
  505. data/vendor/lexbor/source/lexbor/html/interfaces/marquee_element.c +0 -35
  506. data/vendor/lexbor/source/lexbor/html/interfaces/marquee_element.h +0 -34
  507. data/vendor/lexbor/source/lexbor/html/interfaces/media_element.c +0 -35
  508. data/vendor/lexbor/source/lexbor/html/interfaces/media_element.h +0 -34
  509. data/vendor/lexbor/source/lexbor/html/interfaces/menu_element.c +0 -35
  510. data/vendor/lexbor/source/lexbor/html/interfaces/menu_element.h +0 -34
  511. data/vendor/lexbor/source/lexbor/html/interfaces/meta_element.c +0 -35
  512. data/vendor/lexbor/source/lexbor/html/interfaces/meta_element.h +0 -34
  513. data/vendor/lexbor/source/lexbor/html/interfaces/meter_element.c +0 -35
  514. data/vendor/lexbor/source/lexbor/html/interfaces/meter_element.h +0 -34
  515. data/vendor/lexbor/source/lexbor/html/interfaces/mod_element.c +0 -35
  516. data/vendor/lexbor/source/lexbor/html/interfaces/mod_element.h +0 -34
  517. data/vendor/lexbor/source/lexbor/html/interfaces/o_list_element.c +0 -35
  518. data/vendor/lexbor/source/lexbor/html/interfaces/o_list_element.h +0 -34
  519. data/vendor/lexbor/source/lexbor/html/interfaces/object_element.c +0 -35
  520. data/vendor/lexbor/source/lexbor/html/interfaces/object_element.h +0 -34
  521. data/vendor/lexbor/source/lexbor/html/interfaces/opt_group_element.c +0 -35
  522. data/vendor/lexbor/source/lexbor/html/interfaces/opt_group_element.h +0 -34
  523. data/vendor/lexbor/source/lexbor/html/interfaces/option_element.c +0 -260
  524. data/vendor/lexbor/source/lexbor/html/interfaces/option_element.h +0 -71
  525. data/vendor/lexbor/source/lexbor/html/interfaces/output_element.c +0 -35
  526. data/vendor/lexbor/source/lexbor/html/interfaces/output_element.h +0 -34
  527. data/vendor/lexbor/source/lexbor/html/interfaces/paragraph_element.c +0 -35
  528. data/vendor/lexbor/source/lexbor/html/interfaces/paragraph_element.h +0 -34
  529. data/vendor/lexbor/source/lexbor/html/interfaces/param_element.c +0 -35
  530. data/vendor/lexbor/source/lexbor/html/interfaces/param_element.h +0 -34
  531. data/vendor/lexbor/source/lexbor/html/interfaces/picture_element.c +0 -35
  532. data/vendor/lexbor/source/lexbor/html/interfaces/picture_element.h +0 -34
  533. data/vendor/lexbor/source/lexbor/html/interfaces/pre_element.c +0 -35
  534. data/vendor/lexbor/source/lexbor/html/interfaces/pre_element.h +0 -34
  535. data/vendor/lexbor/source/lexbor/html/interfaces/progress_element.c +0 -35
  536. data/vendor/lexbor/source/lexbor/html/interfaces/progress_element.h +0 -34
  537. data/vendor/lexbor/source/lexbor/html/interfaces/quote_element.c +0 -35
  538. data/vendor/lexbor/source/lexbor/html/interfaces/quote_element.h +0 -34
  539. data/vendor/lexbor/source/lexbor/html/interfaces/script_element.c +0 -35
  540. data/vendor/lexbor/source/lexbor/html/interfaces/script_element.h +0 -34
  541. data/vendor/lexbor/source/lexbor/html/interfaces/search_element.c +0 -35
  542. data/vendor/lexbor/source/lexbor/html/interfaces/search_element.h +0 -34
  543. data/vendor/lexbor/source/lexbor/html/interfaces/select_element.c +0 -318
  544. data/vendor/lexbor/source/lexbor/html/interfaces/select_element.h +0 -52
  545. data/vendor/lexbor/source/lexbor/html/interfaces/selectedcontent_element.c +0 -110
  546. data/vendor/lexbor/source/lexbor/html/interfaces/selectedcontent_element.h +0 -45
  547. data/vendor/lexbor/source/lexbor/html/interfaces/slot_element.c +0 -35
  548. data/vendor/lexbor/source/lexbor/html/interfaces/slot_element.h +0 -34
  549. data/vendor/lexbor/source/lexbor/html/interfaces/source_element.c +0 -35
  550. data/vendor/lexbor/source/lexbor/html/interfaces/source_element.h +0 -34
  551. data/vendor/lexbor/source/lexbor/html/interfaces/span_element.c +0 -35
  552. data/vendor/lexbor/source/lexbor/html/interfaces/span_element.h +0 -34
  553. data/vendor/lexbor/source/lexbor/html/interfaces/style_element.c +0 -36
  554. data/vendor/lexbor/source/lexbor/html/interfaces/style_element.h +0 -35
  555. data/vendor/lexbor/source/lexbor/html/interfaces/table_caption_element.c +0 -35
  556. data/vendor/lexbor/source/lexbor/html/interfaces/table_caption_element.h +0 -34
  557. data/vendor/lexbor/source/lexbor/html/interfaces/table_cell_element.c +0 -35
  558. data/vendor/lexbor/source/lexbor/html/interfaces/table_cell_element.h +0 -34
  559. data/vendor/lexbor/source/lexbor/html/interfaces/table_col_element.c +0 -35
  560. data/vendor/lexbor/source/lexbor/html/interfaces/table_col_element.h +0 -34
  561. data/vendor/lexbor/source/lexbor/html/interfaces/table_element.c +0 -35
  562. data/vendor/lexbor/source/lexbor/html/interfaces/table_element.h +0 -34
  563. data/vendor/lexbor/source/lexbor/html/interfaces/table_row_element.c +0 -35
  564. data/vendor/lexbor/source/lexbor/html/interfaces/table_row_element.h +0 -34
  565. data/vendor/lexbor/source/lexbor/html/interfaces/table_section_element.c +0 -35
  566. data/vendor/lexbor/source/lexbor/html/interfaces/table_section_element.h +0 -34
  567. data/vendor/lexbor/source/lexbor/html/interfaces/template_element.c +0 -45
  568. data/vendor/lexbor/source/lexbor/html/interfaces/template_element.h +0 -38
  569. data/vendor/lexbor/source/lexbor/html/interfaces/text_area_element.c +0 -35
  570. data/vendor/lexbor/source/lexbor/html/interfaces/text_area_element.h +0 -34
  571. data/vendor/lexbor/source/lexbor/html/interfaces/time_element.c +0 -35
  572. data/vendor/lexbor/source/lexbor/html/interfaces/time_element.h +0 -34
  573. data/vendor/lexbor/source/lexbor/html/interfaces/title_element.c +0 -138
  574. data/vendor/lexbor/source/lexbor/html/interfaces/title_element.h +0 -42
  575. data/vendor/lexbor/source/lexbor/html/interfaces/track_element.c +0 -35
  576. data/vendor/lexbor/source/lexbor/html/interfaces/track_element.h +0 -34
  577. data/vendor/lexbor/source/lexbor/html/interfaces/u_list_element.c +0 -35
  578. data/vendor/lexbor/source/lexbor/html/interfaces/u_list_element.h +0 -34
  579. data/vendor/lexbor/source/lexbor/html/interfaces/unknown_element.c +0 -35
  580. data/vendor/lexbor/source/lexbor/html/interfaces/unknown_element.h +0 -34
  581. data/vendor/lexbor/source/lexbor/html/interfaces/video_element.c +0 -35
  582. data/vendor/lexbor/source/lexbor/html/interfaces/video_element.h +0 -34
  583. data/vendor/lexbor/source/lexbor/html/interfaces/window.c +0 -36
  584. data/vendor/lexbor/source/lexbor/html/interfaces/window.h +0 -34
  585. data/vendor/lexbor/source/lexbor/html/node.c +0 -14
  586. data/vendor/lexbor/source/lexbor/html/node.h +0 -73
  587. data/vendor/lexbor/source/lexbor/html/parser.c +0 -498
  588. data/vendor/lexbor/source/lexbor/html/parser.h +0 -192
  589. data/vendor/lexbor/source/lexbor/html/serialize.c +0 -2041
  590. data/vendor/lexbor/source/lexbor/html/serialize.h +0 -94
  591. data/vendor/lexbor/source/lexbor/html/serialize_ext.c +0 -2129
  592. data/vendor/lexbor/source/lexbor/html/serialize_ext.h +0 -672
  593. data/vendor/lexbor/source/lexbor/html/tag.c +0 -30
  594. data/vendor/lexbor/source/lexbor/html/tag.h +0 -83
  595. data/vendor/lexbor/source/lexbor/html/tag_res.h +0 -1912
  596. data/vendor/lexbor/source/lexbor/html/token.c +0 -388
  597. data/vendor/lexbor/source/lexbor/html/token.h +0 -147
  598. data/vendor/lexbor/source/lexbor/html/token_attr.c +0 -44
  599. data/vendor/lexbor/source/lexbor/html/token_attr.h +0 -67
  600. data/vendor/lexbor/source/lexbor/html/tokenizer/error.c +0 -106
  601. data/vendor/lexbor/source/lexbor/html/tokenizer/error.h +0 -153
  602. data/vendor/lexbor/source/lexbor/html/tokenizer/res.h +0 -4950
  603. data/vendor/lexbor/source/lexbor/html/tokenizer/state.c +0 -2582
  604. data/vendor/lexbor/source/lexbor/html/tokenizer/state.h +0 -251
  605. data/vendor/lexbor/source/lexbor/html/tokenizer/state_comment.c +0 -496
  606. data/vendor/lexbor/source/lexbor/html/tokenizer/state_comment.h +0 -27
  607. data/vendor/lexbor/source/lexbor/html/tokenizer/state_doctype.c +0 -1659
  608. data/vendor/lexbor/source/lexbor/html/tokenizer/state_doctype.h +0 -27
  609. data/vendor/lexbor/source/lexbor/html/tokenizer/state_rawtext.c +0 -303
  610. data/vendor/lexbor/source/lexbor/html/tokenizer/state_rawtext.h +0 -32
  611. data/vendor/lexbor/source/lexbor/html/tokenizer/state_rcdata.c +0 -311
  612. data/vendor/lexbor/source/lexbor/html/tokenizer/state_rcdata.h +0 -32
  613. data/vendor/lexbor/source/lexbor/html/tokenizer/state_script.c +0 -1209
  614. data/vendor/lexbor/source/lexbor/html/tokenizer/state_script.h +0 -32
  615. data/vendor/lexbor/source/lexbor/html/tokenizer.c +0 -812
  616. data/vendor/lexbor/source/lexbor/html/tokenizer.h +0 -389
  617. data/vendor/lexbor/source/lexbor/html/tree/active_formatting.c +0 -241
  618. data/vendor/lexbor/source/lexbor/html/tree/active_formatting.h +0 -117
  619. data/vendor/lexbor/source/lexbor/html/tree/error.c +0 -94
  620. data/vendor/lexbor/source/lexbor/html/tree/error.h +0 -130
  621. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_after_body.c +0 -73
  622. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_after_frameset.c +0 -74
  623. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_body.c +0 -93
  624. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_frameset.c +0 -98
  625. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_head.c +0 -232
  626. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/before_head.c +0 -154
  627. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/before_html.c +0 -176
  628. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/foreign_content.c +0 -384
  629. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_body.c +0 -2175
  630. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_caption.c +0 -164
  631. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_cell.c +0 -203
  632. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_column_group.c +0 -211
  633. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_frameset.c +0 -159
  634. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_head.c +0 -378
  635. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_head_noscript.c +0 -129
  636. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_row.c +0 -211
  637. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_table.c +0 -482
  638. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_table_body.c +0 -208
  639. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_table_text.c +0 -127
  640. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_template.c +0 -193
  641. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/initial.c +0 -422
  642. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/text.c +0 -70
  643. data/vendor/lexbor/source/lexbor/html/tree/insertion_mode.h +0 -127
  644. data/vendor/lexbor/source/lexbor/html/tree/open_elements.c +0 -337
  645. data/vendor/lexbor/source/lexbor/html/tree/open_elements.h +0 -101
  646. data/vendor/lexbor/source/lexbor/html/tree/open_elements_res.h +0 -427
  647. data/vendor/lexbor/source/lexbor/html/tree/template_insertion.c +0 -10
  648. data/vendor/lexbor/source/lexbor/html/tree/template_insertion.h +0 -100
  649. data/vendor/lexbor/source/lexbor/html/tree.c +0 -1764
  650. data/vendor/lexbor/source/lexbor/html/tree.h +0 -404
  651. data/vendor/lexbor/source/lexbor/html/tree_res.h +0 -111
  652. data/vendor/lexbor/source/lexbor/ns/base.h +0 -32
  653. data/vendor/lexbor/source/lexbor/ns/config.cmake +0 -2
  654. data/vendor/lexbor/source/lexbor/ns/const.h +0 -37
  655. data/vendor/lexbor/source/lexbor/ns/ns.c +0 -155
  656. data/vendor/lexbor/source/lexbor/ns/ns.h +0 -66
  657. data/vendor/lexbor/source/lexbor/ns/res.h +0 -97
  658. data/vendor/lexbor/source/lexbor/ports/posix/config.cmake +0 -15
  659. data/vendor/lexbor/source/lexbor/ports/posix/lexbor/core/fs.c +0 -236
  660. data/vendor/lexbor/source/lexbor/ports/posix/lexbor/core/memory.c +0 -53
  661. data/vendor/lexbor/source/lexbor/ports/posix/lexbor/core/perf.c +0 -214
  662. data/vendor/lexbor/source/lexbor/ports/posix/port.conf +0 -5
  663. data/vendor/lexbor/source/lexbor/ports/windows_nt/config.cmake +0 -18
  664. data/vendor/lexbor/source/lexbor/ports/windows_nt/lexbor/core/fs.c +0 -239
  665. data/vendor/lexbor/source/lexbor/ports/windows_nt/lexbor/core/memory.c +0 -53
  666. data/vendor/lexbor/source/lexbor/ports/windows_nt/lexbor/core/perf.c +0 -81
  667. data/vendor/lexbor/source/lexbor/ports/windows_nt/port.conf +0 -3
  668. data/vendor/lexbor/source/lexbor/punycode/base.h +0 -30
  669. data/vendor/lexbor/source/lexbor/punycode/config.cmake +0 -3
  670. data/vendor/lexbor/source/lexbor/punycode/punycode.c +0 -678
  671. data/vendor/lexbor/source/lexbor/punycode/punycode.h +0 -109
  672. data/vendor/lexbor/source/lexbor/selectors/base.h +0 -30
  673. data/vendor/lexbor/source/lexbor/selectors/config.cmake +0 -2
  674. data/vendor/lexbor/source/lexbor/selectors/selectors.c +0 -2378
  675. data/vendor/lexbor/source/lexbor/selectors/selectors.h +0 -282
  676. data/vendor/lexbor/source/lexbor/style/attribute_steps.c +0 -158
  677. data/vendor/lexbor/source/lexbor/style/attribute_steps.h +0 -49
  678. data/vendor/lexbor/source/lexbor/style/attribute_steps_res.h +0 -427
  679. data/vendor/lexbor/source/lexbor/style/base.h +0 -52
  680. data/vendor/lexbor/source/lexbor/style/config.cmake +0 -2
  681. data/vendor/lexbor/source/lexbor/style/dom/interfaces/document.c +0 -544
  682. data/vendor/lexbor/source/lexbor/style/dom/interfaces/document.h +0 -96
  683. data/vendor/lexbor/source/lexbor/style/dom/interfaces/element.c +0 -795
  684. data/vendor/lexbor/source/lexbor/style/dom/interfaces/element.h +0 -125
  685. data/vendor/lexbor/source/lexbor/style/element_steps.c +0 -180
  686. data/vendor/lexbor/source/lexbor/style/element_steps.h +0 -44
  687. data/vendor/lexbor/source/lexbor/style/element_steps_res.h +0 -427
  688. data/vendor/lexbor/source/lexbor/style/html/interfaces/document.c +0 -182
  689. data/vendor/lexbor/source/lexbor/style/html/interfaces/document.h +0 -214
  690. data/vendor/lexbor/source/lexbor/style/html/interfaces/element.c +0 -293
  691. data/vendor/lexbor/source/lexbor/style/html/interfaces/element.h +0 -211
  692. data/vendor/lexbor/source/lexbor/style/html/interfaces/option_element.c +0 -91
  693. data/vendor/lexbor/source/lexbor/style/html/interfaces/option_element.h +0 -49
  694. data/vendor/lexbor/source/lexbor/style/html/interfaces/style_element.c +0 -131
  695. data/vendor/lexbor/source/lexbor/style/html/interfaces/style_element.h +0 -41
  696. data/vendor/lexbor/source/lexbor/style/style.c +0 -48
  697. data/vendor/lexbor/source/lexbor/style/style.h +0 -40
  698. data/vendor/lexbor/source/lexbor/style/tree/open_elements_res.h +0 -427
  699. data/vendor/lexbor/source/lexbor/tag/base.h +0 -32
  700. data/vendor/lexbor/source/lexbor/tag/config.cmake +0 -2
  701. data/vendor/lexbor/source/lexbor/tag/const.h +0 -230
  702. data/vendor/lexbor/source/lexbor/tag/res.h +0 -568
  703. data/vendor/lexbor/source/lexbor/tag/tag.c +0 -143
  704. data/vendor/lexbor/source/lexbor/tag/tag.h +0 -121
  705. data/vendor/lexbor/source/lexbor/unicode/base.h +0 -157
  706. data/vendor/lexbor/source/lexbor/unicode/config.cmake +0 -3
  707. data/vendor/lexbor/source/lexbor/unicode/idna.c +0 -748
  708. data/vendor/lexbor/source/lexbor/unicode/idna.h +0 -264
  709. data/vendor/lexbor/source/lexbor/unicode/res.h +0 -206549
  710. data/vendor/lexbor/source/lexbor/unicode/unicode.c +0 -1039
  711. data/vendor/lexbor/source/lexbor/unicode/unicode.h +0 -405
  712. data/vendor/lexbor/source/lexbor/url/base.h +0 -32
  713. data/vendor/lexbor/source/lexbor/url/config.cmake +0 -4
  714. data/vendor/lexbor/source/lexbor/url/url.c +0 -5791
  715. data/vendor/lexbor/source/lexbor/url/url.h +0 -984
  716. data/vendor/lexbor/source/lexbor/utils/base.h +0 -32
  717. data/vendor/lexbor/source/lexbor/utils/config.cmake +0 -2
  718. data/vendor/lexbor/source/lexbor/utils/http.c +0 -555
  719. data/vendor/lexbor/source/lexbor/utils/http.h +0 -90
  720. data/vendor/lexbor/source/lexbor/utils/utils.h +0 -15
  721. data/vendor/lexbor/source/lexbor/utils/warc.c +0 -817
  722. data/vendor/lexbor/source/lexbor/utils/warc.h +0 -126
  723. 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: f0b28460a4edb95ca0dd366fe5142748c39e80b1c3d4a4f227a949531d08f106
4
+ data.tar.gz: f099573777282c714387339251261fa7aedc619a5c57be65fba4bd002fcc7b0a
5
5
  SHA512:
6
- metadata.gz: efa98c3ca322d6a3ee141428c1f5e9c3e5b46fba9dde4d7ac75d7dcfdf27d4dd083ef46eed5fb8db21685396d86caeb58e1755f9dd5014d396674cc149378df9
7
- data.tar.gz: 836d97359577dfcd4bd60a8de0dfcf355c596b95fa7fffd5e56a0a355bb4267f3141bf8786f4f905596d79bef44721eeb3bfe4f25fa97e489c5aa3319c9f7655
6
+ metadata.gz: 839d2291c32bd040d244e054567a214a5c5ee60be1b23f6b7c44edf3631001fb64c7fa3e7f3956818fa138ae5f011ab22824a96ef00395608d894d7aae5efeaa
7
+ data.tar.gz: c0a7ed1945f42162ad8445d7cc2fafac32f6ff3c218e0734dd1354dc80844b634a86ddf44531c24a7365c3964f4e1b26172ba635257e3c220132d2a3ee647d99
data/CHANGELOG.md CHANGED
@@ -1,5 +1,94 @@
1
1
  # Changelog
2
2
 
3
+ ## [Unreleased]
4
+
5
+ ## [0.17.0.rc1] - 2026-10-22
6
+
7
+ ### Added
8
+
9
+ * `Makiri::Lexbor::CSS.parse_stylesheet` returns the declarations in an
10
+ at-rule's block (`@font-face`, `@page`, ...) as its `:declarations`; they
11
+ were dropped.
12
+
13
+ ### Changed
14
+
15
+ * HTML is parsed by Makiri's own Rust port of Lexbor's tokenizer and tree
16
+ builder, into a DOM of Makiri's own, and the CSS selector and stylesheet
17
+ parsers are ported too. A parsed document takes about 40% less memory.
18
+ * Installing from source needs Rust 1.84 or newer (and libclang), and no
19
+ longer CMake: the gem carries none of Lexbor's sources, only its LICENSE
20
+ and NOTICE.
21
+ * `Makiri::XML`'s `#css`, `#at_css` and `#matches?` run on the same matcher
22
+ as HTML's and answer as a browser's `querySelectorAll` does in an XML
23
+ document, 10-20x faster on compound selectors (`.item`, `ul li.item`).
24
+ This changes some answers:
25
+ * a bare type selector (`p`) matches that name in any namespace;
26
+ * the root element's namespace declarations are no longer picked up: a
27
+ prefix must be given in the ns Hash, whose `"xmlns"` entry is the
28
+ default namespace (on HTML too);
29
+ * a selector run on a node may match through ancestors outside it
30
+ (`node.css("body p")`); only the node's descendants are returned;
31
+ * `[a=v i]`, `:nth-child(... of S)`, and the form-state and link
32
+ pseudo-classes on XHTML elements are supported;
33
+ * `||` and `:current()` raise `Makiri::CSS::SyntaxError`, and an over-long
34
+ chain `Makiri::Error` (it was `Makiri::XPath::LimitExceeded`).
35
+ * HTML `css(selector, ns)` resolves namespace prefixes: `svg|path` is the SVG
36
+ `path`, `|p` an element in no namespace, `[x|href]` the attribute in `x`'s
37
+ namespace. A prefix the Hash does not bind raises
38
+ `Makiri::CSS::SyntaxError`; prefixes used to be ignored.
39
+ * HTML parsing follows the HTML Standard where Lexbor did not. This affects
40
+ malformed or unusual markup only: `<frameset>`, `<form>` and tables inside
41
+ `<template>`, `<![CDA` or `<!` at the end of the input, the adoption
42
+ agency, `<textarea>`, `<input type=HIDDEN>` and `<image>` in a table,
43
+ `<sup>` in SVG or MathML, and a repeated attribute name (the first is
44
+ kept). Fragment parsing (`#inner_html=`, `#outer_html=`, `Node#parse`,
45
+ `context:` given an element) takes the context element's quirks mode,
46
+ namespace and ancestor `<form>` into account, as browsers do.
47
+ * CSS selectors are parsed as Selectors 4 says: `:has()` inside `:has()` and
48
+ an invalid argument to `:has()` make the selector invalid, an empty
49
+ `:is()` / `:where()` is valid and matches nothing, and `#1a` is not an ID
50
+ selector.
51
+ * `parse_stylesheet` reads names and values by one rule for every property: a
52
+ declaration name is lower-cased unless it is a custom property, an at-rule
53
+ name is lower-cased, and a value is the text as written with whitespace
54
+ runs collapsed (`color: RED` stays `RED`; it came back as `red`).
55
+ `:specificity` is counted as Selectors 4 does (`:is()` / `:not()` /
56
+ `:has()` take their most specific argument).
57
+
58
+ ### Removed
59
+
60
+ * The 10,000-`<option>` limit on a `<select>`: a select with any number of
61
+ options parses in linear time, as browsers parse it.
62
+
63
+ ### Fixed
64
+
65
+ * `parse_stylesheet` keeps a rule such as `a:hover { ... }` inside `@media`
66
+ or `@supports`; it was read as a declaration, which dropped that rule and
67
+ every one after it in the block. A comment between a declaration's name
68
+ and its `:` no longer drops the declarations that follow.
69
+ * A namespaced type selector in the middle of a compound (`.x|a`) raises
70
+ `Makiri::CSS::SyntaxError`, as browsers do.
71
+ * `:any-link` / `:link` match only an HTML `a` or `area`, or an SVG `a`, with
72
+ an `href` (`<link href>` and `<map>` matched). `:read-write` /
73
+ `:read-only` follow the HTML Standard (a checkbox is read-only, an element
74
+ inside `contenteditable` is read-write), and `:empty` ignores processing
75
+ instructions.
76
+ * HTML's `:nth-child` family counts element siblings only:
77
+ `html:first-child` matched nothing after `<!doctype html>`.
78
+ * An attribute keeps the namespace it was made in: `set_attribute_ns` in the
79
+ element's own namespace replaces the attribute it set before instead of
80
+ adding a second, and an attribute removed from its element keeps its
81
+ `namespace_uri`.
82
+ * An attribute name is serialized in the case it was set (`e["viewBox"]` on
83
+ an element in no namespace was written lower-cased).
84
+ * A void element's `#inner_html` is empty even when it has children, and a
85
+ prefixed HTML, SVG or MathML element is written by its local name.
86
+ * `Node#line` of a void element fostered out of a table is its line, not nil.
87
+ * Many namespaces created with `create_element_ns` no longer make lookups
88
+ quadratic.
89
+ * `HTML::Document#import_node` given a document raises "cannot import a
90
+ document; use #dup", as `#clone_node` does.
91
+
3
92
  ## [0.16.0] - 2026-10-10
4
93
 
5
94
  ### Added
@@ -149,7 +149,7 @@ what browsers do - rather than libxml2. Detailed, test-backed notes live in
149
149
  * `<?php ... ?>` in HTML input is a **ProcessingInstruction** node; `#to_html`
150
150
  writes it back as `<?php ... ?>`, and `<?` at end of input is ignored.
151
151
  * The HTML Standard added processing-instruction tokens and tree-construction
152
- rules for them; Makiri follows them through Lexbor. `Nokogiri::HTML5` (gumbo)
152
+ rules for them, and Makiri's parser follows them. `Nokogiri::HTML5` (gumbo)
153
153
  still produces the older bogus comment (`<!--?php ... ?-->`), and
154
154
  `Nokogiri::HTML` (libxml2) its own comment.
155
155
 
@@ -158,17 +158,14 @@ what browsers do - rather than libxml2. Detailed, test-backed notes live in
158
158
  Nokogiri's. `inner_html=`, `outer_html=` and `Node#parse` take no keyword.
159
159
  `Nokogiri::HTML` (libxml2) instead stops at depth 256 and returns the
160
160
  truncated document.
161
- * More than 10,000 `<option>`s in one `<select>` raise `Makiri::Error`;
162
- Nokogiri has no such limit.
163
161
 
164
162
  ## HTML mutation
165
163
 
166
164
  * There is no `Node#name=` / `#node_name=` (on HTML or XML nodes). Nokogiri
167
165
  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).
166
+ an element's tag decides what it is (a `<template>` owns its contents), so a
167
+ node cannot change its tag. Create an element of the new name, move the
168
+ attributes and children, and `replace` the old one (see CHANGELOG.md).
172
169
  * Element and attribute names follow the WHATWG DOM's rules
173
170
  * `create_element`, `[]=` and `set_attribute_ns` raise `ArgumentError` for a
174
171
  name the DOM refuses - one holding whitespace, `/`, `>` (or `=` for an
@@ -224,26 +221,19 @@ what browsers do - rather than libxml2. Detailed, test-backed notes live in
224
221
  * One exception to the DOM: an HTML attribute named `xml:lang` (in no
225
222
  namespace) becomes the XML namespace's `xml:lang`, as the XML reader reads
226
223
  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
224
  * An XML element with a prefix, imported into HTML, keeps it (`h:div` in
234
225
  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.
226
+ browsers: CSS's `div` matches it (the matcher compares the local name),
227
+ XPath's `//div` does not (an HTML element's name test reads its qualified
228
+ name). `#to_html` writes the local name (`<div>`), as the HTML standard
229
+ does.
240
230
 
241
231
  ## CSS
242
232
 
243
233
  * 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.
234
+ * Makiri's selector engine is standards-based. Use XPath
235
+ (`xpath("//p[contains(., 'x')]")`) or Enumerable (`css('li')[1]`) for the
236
+ rest.
247
237
  Standard Level-4 selectors (`:is` / `:where` / `:has`) are supported; some of which Nokogiri rejects.
248
238
  * There is no text-containment pseudo-class. Nokogiri's `:contains()` is
249
239
  not supported, and neither is Lexbor's `:lexbor-contains()`: it raises
@@ -255,33 +245,45 @@ what browsers do - rather than libxml2. Detailed, test-backed notes live in
255
245
  selector) is supported and correct on both HTML and XML - the "type" is the
256
246
  element's own expanded name.
257
247
  * 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.
248
+ (`//*[position()=1]` / `//*[last()=1]`), so it under-matches; Makiri does
249
+ not.
250
+ * CSS resolves a namespace prefix against the `{prefix => uri}` Hash
251
+ (`css(selector, ns)`), on HTML and XML alike: `svg|path` is the SVG `path`
252
+ once `svg` is bound, `|path` an element in no namespace, and a prefix the
253
+ Hash does not bind raises `Makiri::CSS::SyntaxError`. `[x|href]` finds the
254
+ XLink `href` once `x` is bound to XLink. The Hash's `"xmlns"` entry is the
255
+ default namespace, as CSS `@namespace` without a prefix sets one: a type or
256
+ universal selector without a prefix is then in it.
257
+ * Without a default, a bare type selector matches its name in any namespace
258
+ (`path` finds the SVG element, `entry` an Atom entry), as a browser's
259
+ `querySelectorAll` does. `Nokogiri::XML` binds a bare name to the root's
260
+ default namespace when no Hash is given, and to no namespace once one is;
261
+ pass `"xmlns" => uri` (or `"xmlns" => ""`) for that reading.
262
+ * `Makiri::XML` does not collect the document's own declarations: a prefix
263
+ is declared by the Hash or not at all. `Nokogiri::XML` collects the
264
+ root's.
265
+ * A bare `*` under a default namespace is in it, as CSS has it;
266
+ `Nokogiri::XML` matches any element.
267
+ * Up to 0.16 HTML accepted the Hash and ignored every prefix, and
268
+ `Makiri::XML` collected the root's declarations as Nokogiri does.
273
269
  * 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.
270
+ browser, not scoped to that node, on HTML and XML alike:
271
+ `at_css("#c").css("div p")` finds a `p` inside `#c` when `#c` is itself a
272
+ `div`, since the selector is matched against the whole tree and only the
273
+ results are kept to descendants. `Nokogiri::HTML5` and `Nokogiri::XML` scope
274
+ the selector to the node (`#c` cannot be the `div`), and so did
275
+ `Makiri::XML` up to 0.16. There is no `:scope`; for a scoped match, use XPath
276
+ from the node (`xpath(".//div//p")`).
277
+ * The attribute case modifiers (`[a="x" i]`, `[a="x" s]`) are supported on
278
+ both representations. Nokogiri refuses both on either.
279
+ * The form-state and link pseudo-classes (`:checked`, `:disabled`,
280
+ `:enabled`, `:required`, `:optional`, `:placeholder-shown`, `:link`, ...)
281
+ answer on `Makiri::XML` too, for XHTML elements, as browsers do in an XML
282
+ document; on any other element they match nothing. `Nokogiri::XML` refuses
283
+ them.
284
+ * A selector `Makiri` cannot run (the column combinator `||`, `:current()`)
285
+ raises `Makiri::CSS::SyntaxError`, as a browser's `querySelectorAll` throws a
286
+ SyntaxError, on both representations.
285
287
  * `#matches?` answers for a DETACHED node (`document.create_element("p")
286
288
  .matches?("p")` is true, on both representations). Nokogiri raises
287
289
  `NoMethodError` there - it implements `#matches?` as a search from
@@ -294,7 +296,9 @@ what browsers do - rather than libxml2. Detailed, test-backed notes live in
294
296
  therefore matches no type selector.
295
297
  * `Nokogiri::HTML5` is case-sensitive on HTML elements too, so `LI` does not
296
298
  match `<li>` there. `Makiri::XML`'s `#css` is case-sensitive, as XML names
297
- are.
299
+ are - an XHTML element's included, as in a browser's XML document - and so
300
+ are its attribute values, the HTML Standard's case-insensitive list of
301
+ attributes applying only to an HTML document.
298
302
 
299
303
  ## Serialization
300
304
 
data/NOTICE CHANGED
@@ -8,6 +8,13 @@ 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
+
11
18
  The XPath 1.0 engine under ext/makiri/rust/src/xpath/ is an original
12
19
  implementation written for this project. No code is derived from libxml2 or
13
20
  libxslt.
data/README.md CHANGED
@@ -28,8 +28,7 @@ XPath 1.0 evaluation in its own native engine, with no libxml2 dependency.
28
28
  differential, and property-based testing vs Nokogiri (see below).
29
29
  * Bounded, fail-closed execution
30
30
  * 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).
31
+ * HTML parsing bounds the tree depth (`max_tree_depth:`, default 400).
33
32
  * Ownership and borrowing are kept explicit across layers, with owned/borrowed
34
33
  string types and verified text at engine boundaries.
35
34
  * Programmatic invalid input, limit violations, allocation failures, and unsupported constructs
@@ -109,9 +108,10 @@ el = doc.at_xpath("//a:entry", ns)
109
108
  el.local_name # => "entry"
110
109
  el.namespace_uri # => "http://www.w3.org/2005/Atom"
111
110
 
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.
111
+ # CSS selectors work too, as in a browser: a bare type selector matches its
112
+ # name in any namespace, so this just works.
114
113
  doc.css("entry").length # => 2
114
+ doc.css("a|entry", ns).length # => 2 (a prefix the Hash binds)
115
115
  doc.css("feed > entry").map { |e| e.at_css("title").text } # => ["Hello", "World"]
116
116
 
117
117
  # Serialize back to XML
@@ -256,10 +256,13 @@ See also [`spec/conformance/README.md`](spec/conformance/README.md).
256
256
  ## Requirements
257
257
 
258
258
  * CRuby 3.2 or newer.
259
- * A Rust toolchain (stable) with `cargo` - the extension is a Rust crate.
259
+ * Rust 1.84 or newer with `cargo` - the extension is a Rust crate. (Binary
260
+ gems are published for the common platforms, which need no toolchain.)
260
261
  * libclang (clang's development library): rb-sys runs bindgen at build time and
261
262
  reads Ruby's headers through it.
262
- * CMake and a C toolchain, to build the vendored Lexbor static library.
263
+
264
+ Development also needs CMake and a C toolchain, to build the vendored Lexbor
265
+ that the Rust port is tested against (`rake lexbor`).
263
266
 
264
267
  ## Build (development)
265
268
 
@@ -2,6 +2,11 @@
2
2
  name = "makiri_rs"
3
3
  version = "0.0.1"
4
4
  edition = "2021"
5
+ # The oldest Rust a source install builds with - what the release's
6
+ # `source-gem-install` job installs and builds on, so the declaration is
7
+ # tested. It is today's floor (1.84 brought `core::ptr::without_provenance`),
8
+ # not a promise: raise it whenever a newer feature is worth having.
9
+ rust-version = "1.84"
5
10
  publish = false
6
11
  description = "The Makiri gem's extension: HTML5 parsing, XPath 1.0 and an XML reader"
7
12
 
@@ -23,7 +28,7 @@ path = "src/lib.rs"
23
28
  # about an unexpected cfg name (and CI's `clippy -D warnings` turns that into an
24
29
  # error). The proof modules are compiled only under it.
25
30
  [lints.rust]
26
- unexpected_cfgs = { level = "warn", check-cfg = ['cfg(kani)', 'cfg(makiri_asan)'] }
31
+ unexpected_cfgs = { level = "warn", check-cfg = ['cfg(kani)', 'cfg(fuzzing)'] }
27
32
 
28
33
  # The panic gate. A panic now reaches Ruby as an exception (see the profile
29
34
  # below), but it is still an INTERNAL error nobody asked for - `rescue => e`
@@ -44,9 +49,11 @@ expect_used = "warn"
44
49
  panic = "warn"
45
50
 
46
51
  [features]
47
- # Four features. Three name a real optional dependency rather than a step of
48
- # the C port - a Ruby runtime, a vendored C library, and a test hook - and the
49
- # fourth, `css-reference`, a test reference (below).
52
+ # Seven features. Three name a real optional dependency rather than a step of
53
+ # the C port - a Ruby runtime, a vendored C library, and a test hook - three,
54
+ # `css-reference`, `lexbor-reference` and `xml-css-reference`, test
55
+ # references, and the last, `html-dom`, the HTML DOM and everything over it
56
+ # (below).
50
57
  #
51
58
  # The port's thirty-seven per-file flags are gone. They existed so one C file at
52
59
  # a time could be replaced behind an identical ABI; there is no C left to
@@ -55,15 +62,17 @@ default = ["ruby"]
55
62
 
56
63
  # The Ruby boundary: magnus, rb-sys, and everything under `bridge/`, `glue/`
57
64
  # and `init.rs`. Off, the crate is the engine alone - which is what Kani and
58
- # cargo-fuzz build, since neither can link a live Ruby.
59
- ruby = ["lexbor", "dep:magnus", "dep:rb-sys"]
65
+ # cargo-fuzz build, since neither can link a live Ruby. It needs no Lexbor:
66
+ # its HTML DOM is the arena's (`html-dom`).
67
+ ruby = ["dep:magnus", "dep:rb-sys", "html-dom"]
60
68
 
61
69
  # The vendored Lexbor: build.rs runs bindgen over its headers, so this also
62
70
  # decides whether a build needs `vendor/lexbor/dist` to exist at all. `rake
63
71
  # kani` turns it OFF deliberately - the proofs are over the XML reader and the
64
72
  # XPath front end, and not needing a Lexbor build is what lets them run without
65
- # `rake compile` first.
66
- lexbor = []
73
+ # `rake compile` first. Lexbor is only ever the reference the ports are
74
+ # tested against; the HTML DOM beside it is still the arena's.
75
+ lexbor = ["html-dom"]
67
76
 
68
77
  # Allocation-failure injection, the Rust half of `rake oom`. Off,
69
78
  # `falloc::should_fail` is a const false and the branch disappears.
@@ -74,6 +83,24 @@ alloc-inject = []
74
83
  # part of a build that ships.
75
84
  css-reference = ["lexbor"]
76
85
 
86
+ # The CSS-to-XPath lowering (`crate::css`) outside `cfg(test)`, as the
87
+ # reference the `css` fuzz harness holds the matcher's XML instance to - the
88
+ # engine `Makiri::XML`'s CSS ran on before it moved to `css_match`. No
89
+ # dependency, no Lexbor. Never part of a build that ships.
90
+ xml-css-reference = []
91
+
92
+ # Lexbor as the parser port's reference (`lexbor::tree_diff`): its tree,
93
+ # copied into the arena, beside the ported tree builder's, for the
94
+ # `html_diff` fuzz harness. Never part of a build that ships.
95
+ lexbor-reference = ["lexbor"]
96
+
97
+ # The parser port's index-arena DOM (`crate::html::dom`) behind its facade
98
+ # (`crate::html_dom`), parsed by the ported tree builder (`crate::html::tree`),
99
+ # and what sits over it: the HTML CSS matcher, XPath's HTML instance, the
100
+ # bridge's HTML half. Off only in the bare engine (Kani). `ruby` and `lexbor`
101
+ # both turn it on.
102
+ html-dom = []
103
+
77
104
  [dependencies]
78
105
  # Only the `ruby` feature needs these; the engine builds without them, which is
79
106
  # what lets Kani and cargo-fuzz compile it. `rb-sys` is magnus's own binding
@@ -244,6 +244,39 @@ fn main() {
244
244
  .allowlist_function("lxb_css_parser_status_noi")
245
245
  .allowlist_function("lxb_css_parser_memory_set_noi")
246
246
  .allowlist_function("lxb_css_parser_selectors_set_noi")
247
+ // The tokenizer on its own, for the parser conformance harness only
248
+ // (`lexbor::conformance_tests`): the html5lib tokenizer tests drive it
249
+ // from a given initial state with no tree builder behind it. Nothing
250
+ // that ships calls these, so they add declarations and no link.
251
+ .allowlist_function("lxb_html_tokenizer_create")
252
+ .allowlist_function("lxb_html_tokenizer_init")
253
+ .allowlist_function("lxb_html_tokenizer_destroy")
254
+ .allowlist_function("lxb_html_tokenizer_tags_make")
255
+ .allowlist_function("lxb_html_tokenizer_tags_destroy")
256
+ .allowlist_function("lxb_html_tokenizer_attrs_make")
257
+ .allowlist_function("lxb_html_tokenizer_attrs_destroy")
258
+ .allowlist_function("lxb_html_tokenizer_begin")
259
+ .allowlist_function("lxb_html_tokenizer_chunk")
260
+ .allowlist_function("lxb_html_tokenizer_end")
261
+ .allowlist_function("lxb_html_tokenizer_state_data_before")
262
+ .allowlist_function("lxb_html_tokenizer_state_plaintext_before")
263
+ .allowlist_function("lxb_html_tokenizer_state_rcdata_before")
264
+ .allowlist_function("lxb_html_tokenizer_state_rawtext_before")
265
+ .allowlist_function("lxb_html_tokenizer_state_script_data_before")
266
+ .allowlist_function("lxb_html_tokenizer_state_cdata_section_before")
267
+ .allowlist_function("lxb_html_token_attr_name")
268
+ .allowlist_function("lxb_tag_name_by_id_noi")
269
+ .allowlist_type("lxb_dom_attr_id_enum_t")
270
+ // Lexbor's static name tables by id, which the port's generated tables
271
+ // (`html::res`) are checked against, entry by entry.
272
+ .allowlist_function("lxb_tag_name_upper_by_id_noi")
273
+ .allowlist_function("lxb_dom_attr_data_by_id")
274
+ .allowlist_function("lxb_ns_data_by_id")
275
+ .allowlist_function("lxb_ns_prefix_data_by_id")
276
+ .allowlist_type("lxb_ns_prefix_data_t")
277
+ // The tokenizer's recorded parse errors, which the port's are compared
278
+ // with (`lexbor::conformance_tests`).
279
+ .allowlist_type("lxb_html_tokenizer_error_t")
247
280
  // The fragment parse, CHUNKED - begin/process/end rather than the
248
281
  // one-shot `lxb_html_parse_fragment*`, because only between `begin` and
249
282
  // `process` can the tree-depth guard be installed on the tokenizer
@@ -316,8 +349,6 @@ fn main() {
316
349
  .allowlist_function("lxb_selectors_find")
317
350
  .allowlist_function("lxb_selectors_match_node")
318
351
  .allowlist_function("lxb_selectors_opt_set_noi")
319
- // Lexbor's allocator hook (`lexbor::memory`).
320
- .allowlist_function("lexbor_memory_setup")
321
352
  .allowlist_type("lxb_selectors_opt_t")
322
353
  // Top-level consts, not modules: the names then match the headers
323
354
  // exactly and do not depend on bindgen's numbering of anonymous types.
@@ -362,9 +393,9 @@ fn main() {
362
393
  // of them left to keep in agreement.
363
394
  }
364
395
 
365
- /// Where the vendored Lexbor headers are. extconf builds them into
366
- /// `vendor/lexbor/dist` before it invokes cargo, so the default is that path
367
- /// relative to this crate; `MAKIRI_LEXBOR_INCLUDE` overrides it for anything
396
+ /// Where the vendored Lexbor headers are, for the reference builds that
397
+ /// read them (the `lexbor` feature). `rake lexbor` builds them into
398
+ /// `vendor/lexbor/dist`, so the default is that path relative to this crate; `MAKIRI_LEXBOR_INCLUDE` overrides it for anything
368
399
  /// that builds the crate from somewhere else.
369
400
  fn lexbor_include() -> std::path::PathBuf {
370
401
  if let Some(p) = std::env::var_os("MAKIRI_LEXBOR_INCLUDE") {
@@ -374,7 +405,7 @@ fn lexbor_include() -> std::path::PathBuf {
374
405
  let p = manifest.join("../../../vendor/lexbor/dist/include");
375
406
  if !p.join("lexbor/dom/dom.h").exists() {
376
407
  panic!(
377
- "vendored Lexbor headers not found at {} - run `bundle exec rake compile` \
408
+ "vendored Lexbor headers not found at {} - run `bundle exec rake lexbor` \
378
409
  once, or set MAKIRI_LEXBOR_INCLUDE",
379
410
  p.display()
380
411
  );