nokogiri 1.13.10 → 1.14.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of nokogiri might be problematic. Click here for more details.

Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +39 -0
  3. data/LICENSE-DEPENDENCIES.md +830 -509
  4. data/LICENSE.md +1 -1
  5. data/README.md +18 -11
  6. data/dependencies.yml +28 -10
  7. data/ext/nokogiri/extconf.rb +82 -21
  8. data/ext/nokogiri/gumbo.c +20 -10
  9. data/ext/nokogiri/html4_document.c +2 -2
  10. data/ext/nokogiri/html4_element_description.c +1 -1
  11. data/ext/nokogiri/html4_entity_lookup.c +2 -2
  12. data/ext/nokogiri/html4_sax_parser_context.c +1 -6
  13. data/ext/nokogiri/html4_sax_push_parser.c +1 -1
  14. data/ext/nokogiri/nokogiri.c +38 -51
  15. data/ext/nokogiri/nokogiri.h +17 -14
  16. data/ext/nokogiri/test_global_handlers.c +1 -1
  17. data/ext/nokogiri/xml_attr.c +1 -1
  18. data/ext/nokogiri/xml_attribute_decl.c +2 -2
  19. data/ext/nokogiri/xml_cdata.c +2 -2
  20. data/ext/nokogiri/xml_comment.c +1 -1
  21. data/ext/nokogiri/xml_document.c +17 -12
  22. data/ext/nokogiri/xml_document_fragment.c +1 -1
  23. data/ext/nokogiri/xml_dtd.c +1 -1
  24. data/ext/nokogiri/xml_element_content.c +3 -3
  25. data/ext/nokogiri/xml_element_decl.c +2 -2
  26. data/ext/nokogiri/xml_encoding_handler.c +3 -3
  27. data/ext/nokogiri/xml_entity_decl.c +1 -1
  28. data/ext/nokogiri/xml_entity_reference.c +1 -1
  29. data/ext/nokogiri/xml_namespace.c +39 -9
  30. data/ext/nokogiri/xml_node.c +287 -27
  31. data/ext/nokogiri/xml_node_set.c +0 -2
  32. data/ext/nokogiri/xml_processing_instruction.c +1 -1
  33. data/ext/nokogiri/xml_reader.c +41 -21
  34. data/ext/nokogiri/xml_relax_ng.c +1 -3
  35. data/ext/nokogiri/xml_sax_parser.c +23 -17
  36. data/ext/nokogiri/xml_sax_parser_context.c +1 -6
  37. data/ext/nokogiri/xml_sax_push_parser.c +1 -3
  38. data/ext/nokogiri/xml_schema.c +1 -3
  39. data/ext/nokogiri/xml_syntax_error.c +1 -1
  40. data/ext/nokogiri/xml_text.c +1 -1
  41. data/ext/nokogiri/xml_xpath_context.c +87 -83
  42. data/ext/nokogiri/xslt_stylesheet.c +15 -14
  43. data/gumbo-parser/Makefile +10 -0
  44. data/gumbo-parser/src/attribute.h +1 -1
  45. data/gumbo-parser/src/error.c +2 -2
  46. data/gumbo-parser/src/error.h +1 -1
  47. data/gumbo-parser/src/foreign_attrs.c +2 -2
  48. data/gumbo-parser/src/{gumbo.h → nokogiri_gumbo.h} +1 -0
  49. data/gumbo-parser/src/parser.c +8 -5
  50. data/gumbo-parser/src/replacement.h +1 -1
  51. data/gumbo-parser/src/string_buffer.h +1 -1
  52. data/gumbo-parser/src/string_piece.c +1 -1
  53. data/gumbo-parser/src/svg_attrs.c +2 -2
  54. data/gumbo-parser/src/svg_tags.c +2 -2
  55. data/gumbo-parser/src/tag.c +2 -1
  56. data/gumbo-parser/src/tag_lookup.c +7 -7
  57. data/gumbo-parser/src/tag_lookup.gperf +1 -0
  58. data/gumbo-parser/src/tag_lookup.h +1 -1
  59. data/gumbo-parser/src/token_buffer.h +1 -1
  60. data/gumbo-parser/src/tokenizer.c +1 -1
  61. data/gumbo-parser/src/tokenizer.h +1 -1
  62. data/gumbo-parser/src/utf8.c +1 -1
  63. data/gumbo-parser/src/utf8.h +1 -1
  64. data/gumbo-parser/src/util.c +1 -3
  65. data/gumbo-parser/src/util.h +4 -0
  66. data/gumbo-parser/src/vector.h +1 -1
  67. data/lib/nokogiri/css/node.rb +2 -2
  68. data/lib/nokogiri/css/xpath_visitor.rb +5 -3
  69. data/lib/nokogiri/css.rb +6 -0
  70. data/lib/nokogiri/decorators/slop.rb +1 -1
  71. data/lib/nokogiri/encoding_handler.rb +57 -0
  72. data/lib/nokogiri/extension.rb +3 -2
  73. data/lib/nokogiri/html4/document.rb +2 -121
  74. data/lib/nokogiri/html4/element_description_defaults.rb +6 -12
  75. data/lib/nokogiri/html4/encoding_reader.rb +121 -0
  76. data/lib/nokogiri/html4.rb +1 -0
  77. data/lib/nokogiri/html5/document.rb +113 -36
  78. data/lib/nokogiri/html5/document_fragment.rb +9 -2
  79. data/lib/nokogiri/html5/node.rb +3 -5
  80. data/lib/nokogiri/html5.rb +127 -216
  81. data/lib/nokogiri/jruby/dependencies.rb +1 -19
  82. data/lib/nokogiri/jruby/nokogiri_jars.rb +43 -0
  83. data/lib/nokogiri/version/constant.rb +1 -1
  84. data/lib/nokogiri/version/info.rb +11 -10
  85. data/lib/nokogiri/xml/attr.rb +49 -0
  86. data/lib/nokogiri/xml/builder.rb +1 -1
  87. data/lib/nokogiri/xml/document.rb +103 -55
  88. data/lib/nokogiri/xml/document_fragment.rb +49 -6
  89. data/lib/nokogiri/xml/namespace.rb +42 -0
  90. data/lib/nokogiri/xml/node/save_options.rb +6 -4
  91. data/lib/nokogiri/xml/node.rb +190 -35
  92. data/lib/nokogiri/xml/node_set.rb +88 -9
  93. data/lib/nokogiri/xml/parse_options.rb +129 -50
  94. data/lib/nokogiri/xml/pp/node.rb +6 -4
  95. data/lib/nokogiri/xml/processing_instruction.rb +2 -1
  96. data/lib/nokogiri/xml/sax/parser.rb +2 -3
  97. data/lib/nokogiri/xslt.rb +1 -1
  98. data/lib/nokogiri.rb +3 -11
  99. data/lib/xsd/xmlparser/nokogiri.rb +3 -1
  100. data/ports/archives/libxml2-2.10.4.tar.xz +0 -0
  101. metadata +12 -246
  102. data/patches/libxml2/0005-avoid-isnan-isinf.patch +0 -81
  103. data/ports/archives/libxml2-2.10.3.tar.xz +0 -0
@@ -1,81 +0,0 @@
1
- This patch is a result of rake-compiler-dock using centos 7 (manylinux2014) to cross-compile.
2
-
3
- Centos, for reasons I have not been able to discern, implements `isnan` and `isinf` as a function
4
- and not as a macro. Debian knows how to resolve that function at dynamic-link time (despite using a
5
- macro at compile time), but musl-based systems (like alpine) do not. Running `nm` on nokogiri.so
6
- created on such a centos system shows:
7
-
8
- ```
9
- U __isinf@@GLIBC_2.2.5
10
- U __isnan@@GLIBC_2.2.5
11
- ```
12
-
13
- (see https://github.com/sparklemotion/nokogiri/pull/2142 for more info)
14
-
15
- This patch avoids using glibc's `isnan` and `isinf` calls, instead using libxml2's fallback
16
- implementation. There's history here, see libxml2 commit 8813f39:
17
-
18
- commit 8813f39
19
- Author: Nick Wellnhofer <wellnhofer@aevum.de>
20
- Date: 2017-09-21 00:11:26 +0200
21
-
22
- Simplify XPath NaN, inf and -0 handling
23
-
24
- Use C99 macros NAN, INFINITY, isnan, isinf. If they're not available:
25
-
26
- - Assume that (0.0 / 0.0) generates a NaN and !(x == x) tests for NaN.
27
- - Use C89's HUGE_VAL for INFINITY.
28
-
29
- Remove manual handling of NaN, infinity and negative zero in functions
30
- xmlXPathValueFlipSign and xmlXPathDivValues.
31
-
32
- Remove xmlXPathGetSign. All the tests for negative zero can be replaced
33
- with a test for negative or positive zero.
34
-
35
- Simplify xmlXPathRoundFunction.
36
-
37
- Remove Trio dependency.
38
-
39
- This should work on IEEE 754 compliant implementations even if the C99
40
- macros aren't available, but will likely break some ancient platforms.
41
- If problems arise, my plan is to port the relevant trionan.c solution
42
- to xpath.c. Note that non-compliant implementations are impossible
43
- to fully support, anyway, since XPath requires IEEE 754.
44
-
45
- This patch would be unnecessary if any of the following was true:
46
-
47
- * centos implements these as macros, and doesn't generate an unresolved symbol for either in the shared library
48
- * we had a way to ensure `__isinf` and `__isnan` resolve on musl (e.g., we implement them locally)
49
-
50
- diff --git a/xpath.c b/xpath.c
51
- index 9f64ab9..5b6d999 100644
52
- --- a/xpath.c
53
- +++ b/xpath.c
54
- @@ -515,11 +515,7 @@ xmlXPathInit(void) {
55
- */
56
- int
57
- xmlXPathIsNaN(double val) {
58
- -#ifdef isnan
59
- - return isnan(val);
60
- -#else
61
- return !(val == val);
62
- -#endif
63
- }
64
-
65
- /**
66
- @@ -530,15 +530,11 @@ xmlXPathIsNaN(double val) {
67
- */
68
- int
69
- xmlXPathIsInf(double val) {
70
- -#ifdef isinf
71
- - return isinf(val) ? (val > 0 ? 1 : -1) : 0;
72
- -#else
73
- if (val >= xmlXPathPINF)
74
- return 1;
75
- if (val <= -xmlXPathPINF)
76
- return -1;
77
- return 0;
78
- -#endif
79
- }
80
-
81
- #endif /* SCHEMAS or XPATH */
Binary file