nokogiri 1.16.7-aarch64-linux → 1.18.3

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 (208) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +11 -21
  3. data/LICENSE-DEPENDENCIES.md +6 -6
  4. data/README.md +8 -5
  5. data/dependencies.yml +6 -6
  6. data/ext/nokogiri/extconf.rb +188 -142
  7. data/ext/nokogiri/gumbo.c +69 -53
  8. data/ext/nokogiri/html4_document.c +10 -4
  9. data/ext/nokogiri/html4_element_description.c +18 -18
  10. data/ext/nokogiri/html4_sax_parser.c +40 -0
  11. data/ext/nokogiri/html4_sax_parser_context.c +48 -58
  12. data/ext/nokogiri/html4_sax_push_parser.c +25 -24
  13. data/ext/nokogiri/libxml2_polyfill.c +114 -0
  14. data/ext/nokogiri/nokogiri.c +9 -2
  15. data/ext/nokogiri/nokogiri.h +18 -33
  16. data/ext/nokogiri/xml_attr.c +1 -1
  17. data/ext/nokogiri/xml_cdata.c +2 -10
  18. data/ext/nokogiri/xml_comment.c +3 -8
  19. data/ext/nokogiri/xml_document.c +163 -156
  20. data/ext/nokogiri/xml_document_fragment.c +10 -25
  21. data/ext/nokogiri/xml_dtd.c +1 -1
  22. data/ext/nokogiri/xml_element_content.c +9 -9
  23. data/ext/nokogiri/xml_encoding_handler.c +4 -4
  24. data/ext/nokogiri/xml_namespace.c +6 -6
  25. data/ext/nokogiri/xml_node.c +141 -104
  26. data/ext/nokogiri/xml_node_set.c +46 -44
  27. data/ext/nokogiri/xml_reader.c +54 -58
  28. data/ext/nokogiri/xml_relax_ng.c +35 -56
  29. data/ext/nokogiri/xml_sax_parser.c +156 -88
  30. data/ext/nokogiri/xml_sax_parser_context.c +219 -131
  31. data/ext/nokogiri/xml_sax_push_parser.c +68 -49
  32. data/ext/nokogiri/xml_schema.c +50 -85
  33. data/ext/nokogiri/xml_syntax_error.c +19 -11
  34. data/ext/nokogiri/xml_text.c +2 -4
  35. data/ext/nokogiri/xml_xpath_context.c +103 -100
  36. data/ext/nokogiri/xslt_stylesheet.c +8 -8
  37. data/gumbo-parser/src/Makefile +34 -0
  38. data/gumbo-parser/src/README.md +41 -0
  39. data/gumbo-parser/src/ascii.c +75 -0
  40. data/gumbo-parser/src/ascii.h +115 -0
  41. data/gumbo-parser/src/attribute.c +42 -0
  42. data/gumbo-parser/src/attribute.h +17 -0
  43. data/gumbo-parser/src/char_ref.c +22225 -0
  44. data/gumbo-parser/src/char_ref.h +29 -0
  45. data/gumbo-parser/src/char_ref.rl +2154 -0
  46. data/gumbo-parser/src/error.c +658 -0
  47. data/gumbo-parser/src/error.h +152 -0
  48. data/gumbo-parser/src/foreign_attrs.c +103 -0
  49. data/gumbo-parser/src/foreign_attrs.gperf +27 -0
  50. data/gumbo-parser/src/insertion_mode.h +33 -0
  51. data/gumbo-parser/src/macros.h +91 -0
  52. data/gumbo-parser/src/nokogiri_gumbo.h +953 -0
  53. data/gumbo-parser/src/parser.c +4932 -0
  54. data/gumbo-parser/src/parser.h +41 -0
  55. data/gumbo-parser/src/replacement.h +33 -0
  56. data/gumbo-parser/src/string_buffer.c +103 -0
  57. data/gumbo-parser/src/string_buffer.h +68 -0
  58. data/gumbo-parser/src/string_piece.c +48 -0
  59. data/gumbo-parser/src/svg_attrs.c +174 -0
  60. data/gumbo-parser/src/svg_attrs.gperf +77 -0
  61. data/gumbo-parser/src/svg_tags.c +137 -0
  62. data/gumbo-parser/src/svg_tags.gperf +55 -0
  63. data/gumbo-parser/src/tag.c +223 -0
  64. data/gumbo-parser/src/tag_lookup.c +382 -0
  65. data/gumbo-parser/src/tag_lookup.gperf +170 -0
  66. data/gumbo-parser/src/tag_lookup.h +13 -0
  67. data/gumbo-parser/src/token_buffer.c +79 -0
  68. data/gumbo-parser/src/token_buffer.h +71 -0
  69. data/gumbo-parser/src/token_type.h +17 -0
  70. data/gumbo-parser/src/tokenizer.c +3464 -0
  71. data/gumbo-parser/src/tokenizer.h +112 -0
  72. data/gumbo-parser/src/tokenizer_states.h +339 -0
  73. data/gumbo-parser/src/utf8.c +245 -0
  74. data/gumbo-parser/src/utf8.h +164 -0
  75. data/gumbo-parser/src/util.c +66 -0
  76. data/gumbo-parser/src/util.h +34 -0
  77. data/gumbo-parser/src/vector.c +111 -0
  78. data/gumbo-parser/src/vector.h +45 -0
  79. data/lib/nokogiri/class_resolver.rb +1 -1
  80. data/lib/nokogiri/css/node.rb +6 -2
  81. data/lib/nokogiri/css/parser.rb +6 -4
  82. data/lib/nokogiri/css/parser.y +2 -2
  83. data/lib/nokogiri/css/parser_extras.rb +6 -66
  84. data/lib/nokogiri/css/selector_cache.rb +38 -0
  85. data/lib/nokogiri/css/tokenizer.rb +4 -4
  86. data/lib/nokogiri/css/tokenizer.rex +9 -8
  87. data/lib/nokogiri/css/xpath_visitor.rb +43 -6
  88. data/lib/nokogiri/css.rb +86 -20
  89. data/lib/nokogiri/decorators/slop.rb +3 -5
  90. data/lib/nokogiri/encoding_handler.rb +2 -2
  91. data/lib/nokogiri/html4/document.rb +44 -23
  92. data/lib/nokogiri/html4/document_fragment.rb +124 -12
  93. data/lib/nokogiri/html4/encoding_reader.rb +1 -1
  94. data/lib/nokogiri/html4/sax/parser.rb +23 -38
  95. data/lib/nokogiri/html4/sax/parser_context.rb +4 -9
  96. data/lib/nokogiri/html4.rb +9 -14
  97. data/lib/nokogiri/html5/builder.rb +40 -0
  98. data/lib/nokogiri/html5/document.rb +61 -30
  99. data/lib/nokogiri/html5/document_fragment.rb +130 -20
  100. data/lib/nokogiri/html5/node.rb +4 -4
  101. data/lib/nokogiri/html5.rb +114 -72
  102. data/lib/nokogiri/version/constant.rb +1 -1
  103. data/lib/nokogiri/xml/builder.rb +8 -1
  104. data/lib/nokogiri/xml/document.rb +70 -26
  105. data/lib/nokogiri/xml/document_fragment.rb +84 -13
  106. data/lib/nokogiri/xml/node.rb +82 -11
  107. data/lib/nokogiri/xml/node_set.rb +9 -7
  108. data/lib/nokogiri/xml/parse_options.rb +1 -1
  109. data/lib/nokogiri/xml/pp/node.rb +6 -1
  110. data/lib/nokogiri/xml/reader.rb +46 -13
  111. data/lib/nokogiri/xml/relax_ng.rb +57 -20
  112. data/lib/nokogiri/xml/sax/document.rb +174 -83
  113. data/lib/nokogiri/xml/sax/parser.rb +115 -41
  114. data/lib/nokogiri/xml/sax/parser_context.rb +116 -8
  115. data/lib/nokogiri/xml/sax/push_parser.rb +3 -0
  116. data/lib/nokogiri/xml/sax.rb +48 -0
  117. data/lib/nokogiri/xml/schema.rb +112 -45
  118. data/lib/nokogiri/xml/searchable.rb +38 -42
  119. data/lib/nokogiri/xml/syntax_error.rb +22 -0
  120. data/lib/nokogiri/xml/xpath_context.rb +14 -3
  121. data/lib/nokogiri/xml.rb +13 -24
  122. data/lib/nokogiri/xslt.rb +3 -9
  123. data/lib/xsd/xmlparser/nokogiri.rb +3 -4
  124. data/patches/libxml2/0001-Remove-script-macro-support.patch +40 -0
  125. data/patches/libxml2/0002-Update-entities-to-remove-handling-of-ssi.patch +44 -0
  126. data/patches/libxml2/0009-allow-wildcard-namespaces.patch +77 -0
  127. data/patches/libxml2/0010-update-config.guess-and-config.sub-for-libxml2.patch +224 -0
  128. data/patches/libxml2/0011-rip-out-libxml2-s-libc_single_threaded-support.patch +30 -0
  129. data/patches/libxml2/0019-xpath-Use-separate-static-hash-table-for-standard-fu.patch +244 -0
  130. data/patches/libxslt/0001-update-config.guess-and-config.sub-for-libxslt.patch +224 -0
  131. data/ports/archives/libxml2-2.13.6.tar.xz +0 -0
  132. data/ports/archives/libxslt-1.1.42.tar.xz +0 -0
  133. metadata +78 -89
  134. data/ext/nokogiri/include/libexslt/exslt.h +0 -108
  135. data/ext/nokogiri/include/libexslt/exsltconfig.h +0 -70
  136. data/ext/nokogiri/include/libexslt/exsltexports.h +0 -63
  137. data/ext/nokogiri/include/libxml2/libxml/HTMLparser.h +0 -343
  138. data/ext/nokogiri/include/libxml2/libxml/HTMLtree.h +0 -147
  139. data/ext/nokogiri/include/libxml2/libxml/SAX.h +0 -202
  140. data/ext/nokogiri/include/libxml2/libxml/SAX2.h +0 -171
  141. data/ext/nokogiri/include/libxml2/libxml/c14n.h +0 -126
  142. data/ext/nokogiri/include/libxml2/libxml/catalog.h +0 -182
  143. data/ext/nokogiri/include/libxml2/libxml/chvalid.h +0 -230
  144. data/ext/nokogiri/include/libxml2/libxml/debugXML.h +0 -217
  145. data/ext/nokogiri/include/libxml2/libxml/dict.h +0 -82
  146. data/ext/nokogiri/include/libxml2/libxml/encoding.h +0 -235
  147. data/ext/nokogiri/include/libxml2/libxml/entities.h +0 -155
  148. data/ext/nokogiri/include/libxml2/libxml/globals.h +0 -41
  149. data/ext/nokogiri/include/libxml2/libxml/hash.h +0 -232
  150. data/ext/nokogiri/include/libxml2/libxml/list.h +0 -137
  151. data/ext/nokogiri/include/libxml2/libxml/nanoftp.h +0 -186
  152. data/ext/nokogiri/include/libxml2/libxml/nanohttp.h +0 -81
  153. data/ext/nokogiri/include/libxml2/libxml/parser.h +0 -1384
  154. data/ext/nokogiri/include/libxml2/libxml/parserInternals.h +0 -663
  155. data/ext/nokogiri/include/libxml2/libxml/pattern.h +0 -100
  156. data/ext/nokogiri/include/libxml2/libxml/relaxng.h +0 -219
  157. data/ext/nokogiri/include/libxml2/libxml/schemasInternals.h +0 -959
  158. data/ext/nokogiri/include/libxml2/libxml/schematron.h +0 -143
  159. data/ext/nokogiri/include/libxml2/libxml/threads.h +0 -87
  160. data/ext/nokogiri/include/libxml2/libxml/tree.h +0 -1362
  161. data/ext/nokogiri/include/libxml2/libxml/uri.h +0 -95
  162. data/ext/nokogiri/include/libxml2/libxml/valid.h +0 -450
  163. data/ext/nokogiri/include/libxml2/libxml/xinclude.h +0 -129
  164. data/ext/nokogiri/include/libxml2/libxml/xlink.h +0 -189
  165. data/ext/nokogiri/include/libxml2/libxml/xmlIO.h +0 -421
  166. data/ext/nokogiri/include/libxml2/libxml/xmlautomata.h +0 -146
  167. data/ext/nokogiri/include/libxml2/libxml/xmlerror.h +0 -948
  168. data/ext/nokogiri/include/libxml2/libxml/xmlexports.h +0 -50
  169. data/ext/nokogiri/include/libxml2/libxml/xmlmemory.h +0 -225
  170. data/ext/nokogiri/include/libxml2/libxml/xmlmodule.h +0 -57
  171. data/ext/nokogiri/include/libxml2/libxml/xmlreader.h +0 -434
  172. data/ext/nokogiri/include/libxml2/libxml/xmlregexp.h +0 -215
  173. data/ext/nokogiri/include/libxml2/libxml/xmlsave.h +0 -97
  174. data/ext/nokogiri/include/libxml2/libxml/xmlschemas.h +0 -249
  175. data/ext/nokogiri/include/libxml2/libxml/xmlschemastypes.h +0 -152
  176. data/ext/nokogiri/include/libxml2/libxml/xmlstring.h +0 -140
  177. data/ext/nokogiri/include/libxml2/libxml/xmlunicode.h +0 -202
  178. data/ext/nokogiri/include/libxml2/libxml/xmlversion.h +0 -511
  179. data/ext/nokogiri/include/libxml2/libxml/xmlwriter.h +0 -488
  180. data/ext/nokogiri/include/libxml2/libxml/xpath.h +0 -575
  181. data/ext/nokogiri/include/libxml2/libxml/xpathInternals.h +0 -633
  182. data/ext/nokogiri/include/libxml2/libxml/xpointer.h +0 -138
  183. data/ext/nokogiri/include/libxslt/attributes.h +0 -39
  184. data/ext/nokogiri/include/libxslt/documents.h +0 -93
  185. data/ext/nokogiri/include/libxslt/extensions.h +0 -262
  186. data/ext/nokogiri/include/libxslt/extra.h +0 -72
  187. data/ext/nokogiri/include/libxslt/functions.h +0 -78
  188. data/ext/nokogiri/include/libxslt/imports.h +0 -75
  189. data/ext/nokogiri/include/libxslt/keys.h +0 -53
  190. data/ext/nokogiri/include/libxslt/namespaces.h +0 -68
  191. data/ext/nokogiri/include/libxslt/numbersInternals.h +0 -73
  192. data/ext/nokogiri/include/libxslt/pattern.h +0 -84
  193. data/ext/nokogiri/include/libxslt/preproc.h +0 -43
  194. data/ext/nokogiri/include/libxslt/security.h +0 -104
  195. data/ext/nokogiri/include/libxslt/templates.h +0 -77
  196. data/ext/nokogiri/include/libxslt/transform.h +0 -207
  197. data/ext/nokogiri/include/libxslt/variables.h +0 -118
  198. data/ext/nokogiri/include/libxslt/xslt.h +0 -110
  199. data/ext/nokogiri/include/libxslt/xsltInternals.h +0 -1992
  200. data/ext/nokogiri/include/libxslt/xsltconfig.h +0 -179
  201. data/ext/nokogiri/include/libxslt/xsltexports.h +0 -64
  202. data/ext/nokogiri/include/libxslt/xsltlocale.h +0 -44
  203. data/ext/nokogiri/include/libxslt/xsltutils.h +0 -343
  204. data/ext/nokogiri/libxml2_backwards_compat.c +0 -121
  205. data/lib/nokogiri/3.0/nokogiri.so +0 -0
  206. data/lib/nokogiri/3.1/nokogiri.so +0 -0
  207. data/lib/nokogiri/3.2/nokogiri.so +0 -0
  208. data/lib/nokogiri/3.3/nokogiri.so +0 -0
@@ -0,0 +1,115 @@
1
+ #ifndef GUMBO_ASCII_H_
2
+ #define GUMBO_ASCII_H_
3
+
4
+ #include <stddef.h>
5
+ #include "macros.h"
6
+
7
+ #ifdef __cplusplus
8
+ extern "C" {
9
+ #endif
10
+
11
+ PURE NONNULL_ARGS
12
+ int gumbo_ascii_strcasecmp(const char *s1, const char *s2);
13
+
14
+ PURE NONNULL_ARGS
15
+ int gumbo_ascii_strncasecmp(const char *s1, const char *s2, size_t n);
16
+
17
+ // If these values change, then _gumbo_ascii_table needs to be regenerated.
18
+ #define GUMBO_ASCII_CNTRL 1
19
+ #define GUMBO_ASCII_SPACE 2
20
+ #define GUMBO_ASCII_DIGIT 4
21
+ #define GUMBO_ASCII_UPPER_XDIGIT 8
22
+ #define GUMBO_ASCII_LOWER_XDIGIT 16
23
+ #define GUMBO_ASCII_UPPER_ALPHA 32
24
+ #define GUMBO_ASCII_LOWER_ALPHA 64
25
+ #define GUMBO_ASCII_XDIGIT (GUMBO_ASCII_LOWER_XDIGIT | GUMBO_ASCII_UPPER_XDIGIT)
26
+ #define GUMBO_ASCII_ALPHA (GUMBO_ASCII_UPPER_ALPHA | GUMBO_ASCII_LOWER_ALPHA)
27
+ #define GUMBO_ASCII_ALNUM (GUMBO_ASCII_DIGIT | GUMBO_ASCII_ALPHA)
28
+
29
+ extern const unsigned char _gumbo_ascii_table[0x80];
30
+
31
+ CONST_FN
32
+ static inline int gumbo_ascii_isascii(int c) {
33
+ return ((unsigned int)c & ~0x7fu) == 0;
34
+ }
35
+
36
+ // 0x00 -- 0x1F (A C0 control)
37
+ CONST_FN
38
+ static inline int gumbo_ascii_iscntrl(int c) {
39
+ return gumbo_ascii_isascii(c)
40
+ && (_gumbo_ascii_table[c] & GUMBO_ASCII_CNTRL);
41
+ }
42
+
43
+ // 0x09, 0x0a, 0x0c, 0x0d, 0x20
44
+ CONST_FN
45
+ static inline int gumbo_ascii_isspace(int c) {
46
+ return gumbo_ascii_isascii(c)
47
+ && (_gumbo_ascii_table[c] & GUMBO_ASCII_SPACE);
48
+ }
49
+
50
+ CONST_FN
51
+ static inline int gumbo_ascii_istab_or_newline(int c) {
52
+ return c == 0x09 || c == 0x0a || c == 0x0d;
53
+ }
54
+
55
+
56
+ CONST_FN
57
+ static inline int gumbo_ascii_isdigit(int c) {
58
+ return c >= 0x30 && c <= 0x39;
59
+ }
60
+
61
+ CONST_FN
62
+ static inline int gumbo_ascii_isalpha(int c) {
63
+ return gumbo_ascii_isascii(c)
64
+ && (_gumbo_ascii_table[c] & GUMBO_ASCII_ALPHA);
65
+ }
66
+
67
+ CONST_FN
68
+ static inline int gumbo_ascii_isxdigit(int c) {
69
+ return gumbo_ascii_isascii(c)
70
+ && (_gumbo_ascii_table[c] & GUMBO_ASCII_XDIGIT);
71
+ }
72
+
73
+ CONST_FN
74
+ static inline int gumbo_ascii_isupper_xdigit(int c) {
75
+ return gumbo_ascii_isascii(c)
76
+ && (_gumbo_ascii_table[c] & GUMBO_ASCII_UPPER_XDIGIT);
77
+ }
78
+
79
+ CONST_FN
80
+ static inline int gumbo_ascii_islower_xdigit(int c) {
81
+ return gumbo_ascii_isascii(c)
82
+ && (_gumbo_ascii_table[c] & GUMBO_ASCII_LOWER_XDIGIT);
83
+ }
84
+
85
+ CONST_FN
86
+ static inline int gumbo_ascii_isupper(int c) {
87
+ return ((unsigned)(c) - 'A') < 26;
88
+ }
89
+
90
+ CONST_FN
91
+ static inline int gumbo_ascii_islower(int c) {
92
+ return gumbo_ascii_isascii(c)
93
+ && (_gumbo_ascii_table[c] & GUMBO_ASCII_LOWER_ALPHA);
94
+ }
95
+
96
+ CONST_FN
97
+ static inline int gumbo_ascii_isalnum(int c) {
98
+ return gumbo_ascii_isascii(c)
99
+ && (_gumbo_ascii_table[c] & GUMBO_ASCII_ALNUM);
100
+ }
101
+
102
+
103
+ CONST_FN
104
+ static inline int gumbo_ascii_tolower(int c) {
105
+ if (gumbo_ascii_isupper(c)) {
106
+ return c | 32;
107
+ }
108
+ return c;
109
+ }
110
+
111
+ #ifdef __cplusplus
112
+ }
113
+ #endif
114
+
115
+ #endif // GUMBO_ASCII_H_
@@ -0,0 +1,42 @@
1
+ /*
2
+ Copyright 2018 Craig Barnes.
3
+ Copyright 2010 Google Inc.
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ https://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+ */
17
+
18
+ #include <assert.h>
19
+ #include <stdlib.h>
20
+ #include <string.h>
21
+ #include "attribute.h"
22
+ #include "ascii.h"
23
+ #include "util.h"
24
+
25
+ GumboAttribute* gumbo_get_attribute (
26
+ const GumboVector* attributes,
27
+ const char* name
28
+ ) {
29
+ for (unsigned int i = 0; i < attributes->length; ++i) {
30
+ GumboAttribute* attr = attributes->data[i];
31
+ if (!gumbo_ascii_strcasecmp(attr->name, name)) {
32
+ return attr;
33
+ }
34
+ }
35
+ return NULL;
36
+ }
37
+
38
+ void gumbo_destroy_attribute(GumboAttribute* attribute) {
39
+ gumbo_free((void*) attribute->name);
40
+ gumbo_free((void*) attribute->value);
41
+ gumbo_free((void*) attribute);
42
+ }
@@ -0,0 +1,17 @@
1
+ #ifndef GUMBO_ATTRIBUTE_H_
2
+ #define GUMBO_ATTRIBUTE_H_
3
+
4
+ #include "nokogiri_gumbo.h"
5
+
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
9
+
10
+ // Release the memory used for a GumboAttribute, including the attribute itself
11
+ void gumbo_destroy_attribute(GumboAttribute* attribute);
12
+
13
+ #ifdef __cplusplus
14
+ }
15
+ #endif
16
+
17
+ #endif // GUMBO_ATTRIBUTE_H_