nokolexbor 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ext/nokolexbor/config.h +186 -0
- data/ext/nokolexbor/extconf.rb +131 -0
- data/ext/nokolexbor/libxml/HTMLparser.h +320 -0
- data/ext/nokolexbor/libxml/SAX2.h +173 -0
- data/ext/nokolexbor/libxml/chvalid.h +230 -0
- data/ext/nokolexbor/libxml/debugXML.h +217 -0
- data/ext/nokolexbor/libxml/dict.h +81 -0
- data/ext/nokolexbor/libxml/encoding.h +232 -0
- data/ext/nokolexbor/libxml/entities.h +153 -0
- data/ext/nokolexbor/libxml/globals.h +529 -0
- data/ext/nokolexbor/libxml/hash.h +236 -0
- data/ext/nokolexbor/libxml/list.h +137 -0
- data/ext/nokolexbor/libxml/parser.h +1264 -0
- data/ext/nokolexbor/libxml/parserInternals.h +641 -0
- data/ext/nokolexbor/libxml/pattern.h +100 -0
- data/ext/nokolexbor/libxml/threads.h +94 -0
- data/ext/nokolexbor/libxml/tree.h +1315 -0
- data/ext/nokolexbor/libxml/uri.h +94 -0
- data/ext/nokolexbor/libxml/valid.h +448 -0
- data/ext/nokolexbor/libxml/xmlIO.h +369 -0
- data/ext/nokolexbor/libxml/xmlautomata.h +146 -0
- data/ext/nokolexbor/libxml/xmlerror.h +919 -0
- data/ext/nokolexbor/libxml/xmlexports.h +79 -0
- data/ext/nokolexbor/libxml/xmlmemory.h +226 -0
- data/ext/nokolexbor/libxml/xmlregexp.h +222 -0
- data/ext/nokolexbor/libxml/xmlstring.h +140 -0
- data/ext/nokolexbor/libxml/xmlversion.h +526 -0
- data/ext/nokolexbor/libxml/xpath.h +575 -0
- data/ext/nokolexbor/libxml/xpathInternals.h +632 -0
- data/ext/nokolexbor/libxml/xpointer.h +137 -0
- data/ext/nokolexbor/libxml.h +76 -0
- data/ext/nokolexbor/memory.c +39 -0
- data/ext/nokolexbor/nl_document.c +51 -0
- data/ext/nokolexbor/nl_node.c +790 -0
- data/ext/nokolexbor/nl_node_set.c +368 -0
- data/ext/nokolexbor/nl_xpath_context.c +200 -0
- data/ext/nokolexbor/nokolexbor.c +63 -0
- data/ext/nokolexbor/nokolexbor.h +37 -0
- data/ext/nokolexbor/private/buf.h +70 -0
- data/ext/nokolexbor/private/dict.h +11 -0
- data/ext/nokolexbor/private/enc.h +17 -0
- data/ext/nokolexbor/private/error.h +21 -0
- data/ext/nokolexbor/private/globals.h +9 -0
- data/ext/nokolexbor/private/memory.h +9 -0
- data/ext/nokolexbor/private/parser.h +27 -0
- data/ext/nokolexbor/private/string.h +9 -0
- data/ext/nokolexbor/private/threads.h +50 -0
- data/ext/nokolexbor/private/tree.h +18 -0
- data/ext/nokolexbor/private/xpath.h +7 -0
- data/ext/nokolexbor/timsort.h +601 -0
- data/ext/nokolexbor/xml_SAX2.c +80 -0
- data/ext/nokolexbor/xml_buf.c +363 -0
- data/ext/nokolexbor/xml_chvalid.c +334 -0
- data/ext/nokolexbor/xml_dict.c +1264 -0
- data/ext/nokolexbor/xml_encoding.c +124 -0
- data/ext/nokolexbor/xml_error.c +134 -0
- data/ext/nokolexbor/xml_globals.c +1085 -0
- data/ext/nokolexbor/xml_hash.c +1141 -0
- data/ext/nokolexbor/xml_memory.c +203 -0
- data/ext/nokolexbor/xml_parser.c +127 -0
- data/ext/nokolexbor/xml_parserInternals.c +338 -0
- data/ext/nokolexbor/xml_pattern.c +2375 -0
- data/ext/nokolexbor/xml_string.c +1051 -0
- data/ext/nokolexbor/xml_threads.c +881 -0
- data/ext/nokolexbor/xml_tree.c +148 -0
- data/ext/nokolexbor/xml_xpath.c +14743 -0
- data/lib/nokolexbor/attribute.rb +18 -0
- data/lib/nokolexbor/document.rb +6 -0
- data/lib/nokolexbor/node.rb +264 -0
- data/lib/nokolexbor/node_set.rb +124 -0
- data/lib/nokolexbor/version.rb +5 -0
- data/lib/nokolexbor/xpath_context.rb +14 -0
- data/lib/nokolexbor.rb +17 -0
- data/patches/0001-lexbor-support-text-pseudo-element.patch +137 -0
- data/patches/0002-lexbor-match-id-class-case-sensitive.patch +22 -0
- data/patches/0003-lexbor-attach-template-content-to-self.patch +13 -0
- data/vendor/lexbor/CMakeLists.txt +331 -0
- data/vendor/lexbor/config.cmake +890 -0
- data/vendor/lexbor/feature.cmake +134 -0
- data/vendor/lexbor/source/lexbor/core/array.c +208 -0
- data/vendor/lexbor/source/lexbor/core/array.h +100 -0
- data/vendor/lexbor/source/lexbor/core/array_obj.c +216 -0
- data/vendor/lexbor/source/lexbor/core/array_obj.h +134 -0
- data/vendor/lexbor/source/lexbor/core/avl.c +442 -0
- data/vendor/lexbor/source/lexbor/core/avl.h +82 -0
- data/vendor/lexbor/source/lexbor/core/base.h +86 -0
- data/vendor/lexbor/source/lexbor/core/bst.c +468 -0
- data/vendor/lexbor/source/lexbor/core/bst.h +108 -0
- data/vendor/lexbor/source/lexbor/core/bst_map.c +238 -0
- data/vendor/lexbor/source/lexbor/core/bst_map.h +87 -0
- data/vendor/lexbor/source/lexbor/core/config.cmake +12 -0
- data/vendor/lexbor/source/lexbor/core/conv.c +203 -0
- data/vendor/lexbor/source/lexbor/core/conv.h +53 -0
- data/vendor/lexbor/source/lexbor/core/core.h +35 -0
- data/vendor/lexbor/source/lexbor/core/def.h +57 -0
- data/vendor/lexbor/source/lexbor/core/diyfp.c +153 -0
- data/vendor/lexbor/source/lexbor/core/diyfp.h +258 -0
- data/vendor/lexbor/source/lexbor/core/dobject.c +187 -0
- data/vendor/lexbor/source/lexbor/core/dobject.h +92 -0
- data/vendor/lexbor/source/lexbor/core/dtoa.c +404 -0
- data/vendor/lexbor/source/lexbor/core/dtoa.h +28 -0
- data/vendor/lexbor/source/lexbor/core/fs.h +60 -0
- data/vendor/lexbor/source/lexbor/core/hash.c +476 -0
- data/vendor/lexbor/source/lexbor/core/hash.h +218 -0
- data/vendor/lexbor/source/lexbor/core/in.c +267 -0
- data/vendor/lexbor/source/lexbor/core/in.h +172 -0
- data/vendor/lexbor/source/lexbor/core/lexbor.h +35 -0
- data/vendor/lexbor/source/lexbor/core/mem.c +228 -0
- data/vendor/lexbor/source/lexbor/core/mem.h +141 -0
- data/vendor/lexbor/source/lexbor/core/mraw.c +428 -0
- data/vendor/lexbor/source/lexbor/core/mraw.h +114 -0
- data/vendor/lexbor/source/lexbor/core/perf.h +45 -0
- data/vendor/lexbor/source/lexbor/core/plog.c +73 -0
- data/vendor/lexbor/source/lexbor/core/plog.h +102 -0
- data/vendor/lexbor/source/lexbor/core/print.c +168 -0
- data/vendor/lexbor/source/lexbor/core/print.h +39 -0
- data/vendor/lexbor/source/lexbor/core/sbst.h +59 -0
- data/vendor/lexbor/source/lexbor/core/serialize.c +27 -0
- data/vendor/lexbor/source/lexbor/core/serialize.h +32 -0
- data/vendor/lexbor/source/lexbor/core/shs.c +118 -0
- data/vendor/lexbor/source/lexbor/core/shs.h +82 -0
- data/vendor/lexbor/source/lexbor/core/str.c +617 -0
- data/vendor/lexbor/source/lexbor/core/str.h +247 -0
- data/vendor/lexbor/source/lexbor/core/str_res.h +369 -0
- data/vendor/lexbor/source/lexbor/core/strtod.c +326 -0
- data/vendor/lexbor/source/lexbor/core/strtod.h +28 -0
- data/vendor/lexbor/source/lexbor/core/types.h +39 -0
- data/vendor/lexbor/source/lexbor/core/utils.c +43 -0
- data/vendor/lexbor/source/lexbor/core/utils.h +36 -0
- data/vendor/lexbor/source/lexbor/css/base.h +44 -0
- data/vendor/lexbor/source/lexbor/css/config.cmake +2 -0
- data/vendor/lexbor/source/lexbor/css/css.h +25 -0
- data/vendor/lexbor/source/lexbor/css/log.c +336 -0
- data/vendor/lexbor/source/lexbor/css/log.h +103 -0
- data/vendor/lexbor/source/lexbor/css/node.h +29 -0
- data/vendor/lexbor/source/lexbor/css/parser.c +473 -0
- data/vendor/lexbor/source/lexbor/css/parser.h +368 -0
- data/vendor/lexbor/source/lexbor/css/selectors/base.h +48 -0
- data/vendor/lexbor/source/lexbor/css/selectors/pseudo.c +91 -0
- data/vendor/lexbor/source/lexbor/css/selectors/pseudo.h +66 -0
- data/vendor/lexbor/source/lexbor/css/selectors/pseudo_const.h +109 -0
- data/vendor/lexbor/source/lexbor/css/selectors/pseudo_res.h +302 -0
- data/vendor/lexbor/source/lexbor/css/selectors/pseudo_state.c +279 -0
- data/vendor/lexbor/source/lexbor/css/selectors/pseudo_state.h +85 -0
- data/vendor/lexbor/source/lexbor/css/selectors/selector.c +927 -0
- data/vendor/lexbor/source/lexbor/css/selectors/selector.h +200 -0
- data/vendor/lexbor/source/lexbor/css/selectors/selectors.c +340 -0
- data/vendor/lexbor/source/lexbor/css/selectors/selectors.h +137 -0
- data/vendor/lexbor/source/lexbor/css/selectors/state.c +1718 -0
- data/vendor/lexbor/source/lexbor/css/selectors/state.h +79 -0
- data/vendor/lexbor/source/lexbor/css/stylesheet.h +37 -0
- data/vendor/lexbor/source/lexbor/css/syntax/anb.c +443 -0
- data/vendor/lexbor/source/lexbor/css/syntax/anb.h +45 -0
- data/vendor/lexbor/source/lexbor/css/syntax/base.h +33 -0
- data/vendor/lexbor/source/lexbor/css/syntax/parser.c +9 -0
- data/vendor/lexbor/source/lexbor/css/syntax/parser.h +25 -0
- data/vendor/lexbor/source/lexbor/css/syntax/res.h +48 -0
- data/vendor/lexbor/source/lexbor/css/syntax/state.c +2603 -0
- data/vendor/lexbor/source/lexbor/css/syntax/state.h +140 -0
- data/vendor/lexbor/source/lexbor/css/syntax/state_res.h +273 -0
- data/vendor/lexbor/source/lexbor/css/syntax/syntax.c +67 -0
- data/vendor/lexbor/source/lexbor/css/syntax/token.c +618 -0
- data/vendor/lexbor/source/lexbor/css/syntax/token.h +298 -0
- data/vendor/lexbor/source/lexbor/css/syntax/token_res.h +68 -0
- data/vendor/lexbor/source/lexbor/css/syntax/tokenizer/error.c +30 -0
- data/vendor/lexbor/source/lexbor/css/syntax/tokenizer/error.h +58 -0
- data/vendor/lexbor/source/lexbor/css/syntax/tokenizer.c +278 -0
- data/vendor/lexbor/source/lexbor/css/syntax/tokenizer.h +121 -0
- data/vendor/lexbor/source/lexbor/dom/base.h +32 -0
- data/vendor/lexbor/source/lexbor/dom/collection.c +97 -0
- data/vendor/lexbor/source/lexbor/dom/collection.h +112 -0
- data/vendor/lexbor/source/lexbor/dom/config.cmake +3 -0
- data/vendor/lexbor/source/lexbor/dom/dom.h +29 -0
- data/vendor/lexbor/source/lexbor/dom/exception.c +18 -0
- data/vendor/lexbor/source/lexbor/dom/exception.h +73 -0
- data/vendor/lexbor/source/lexbor/dom/interface.c +110 -0
- data/vendor/lexbor/source/lexbor/dom/interface.h +88 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/attr.c +445 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/attr.h +152 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/attr_const.h +62 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/attr_res.h +143 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/cdata_section.c +55 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/cdata_section.h +38 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/character_data.c +110 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/character_data.h +51 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/comment.c +64 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/comment.h +42 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/document.c +536 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/document.h +243 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/document_fragment.c +36 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/document_fragment.h +36 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/document_type.c +125 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/document_type.h +108 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/element.c +1411 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/element.h +319 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/event_target.c +32 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/event_target.h +34 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/node.c +661 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/node.h +192 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/processing_instruction.c +87 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/processing_instruction.h +66 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/shadow_root.c +36 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/shadow_root.h +44 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/text.c +63 -0
- data/vendor/lexbor/source/lexbor/dom/interfaces/text.h +42 -0
- data/vendor/lexbor/source/lexbor/encoding/base.h +218 -0
- data/vendor/lexbor/source/lexbor/encoding/big5.c +42839 -0
- data/vendor/lexbor/source/lexbor/encoding/config.cmake +12 -0
- data/vendor/lexbor/source/lexbor/encoding/const.h +65 -0
- data/vendor/lexbor/source/lexbor/encoding/decode.c +3193 -0
- data/vendor/lexbor/source/lexbor/encoding/decode.h +370 -0
- data/vendor/lexbor/source/lexbor/encoding/encode.c +1931 -0
- data/vendor/lexbor/source/lexbor/encoding/encode.h +377 -0
- data/vendor/lexbor/source/lexbor/encoding/encoding.c +252 -0
- data/vendor/lexbor/source/lexbor/encoding/encoding.h +475 -0
- data/vendor/lexbor/source/lexbor/encoding/euc_kr.c +53883 -0
- data/vendor/lexbor/source/lexbor/encoding/gb18030.c +47905 -0
- data/vendor/lexbor/source/lexbor/encoding/iso_2022_jp_katakana.c +159 -0
- data/vendor/lexbor/source/lexbor/encoding/jis0208.c +22477 -0
- data/vendor/lexbor/source/lexbor/encoding/jis0212.c +15787 -0
- data/vendor/lexbor/source/lexbor/encoding/multi.h +53 -0
- data/vendor/lexbor/source/lexbor/encoding/range.c +71 -0
- data/vendor/lexbor/source/lexbor/encoding/range.h +34 -0
- data/vendor/lexbor/source/lexbor/encoding/res.c +222 -0
- data/vendor/lexbor/source/lexbor/encoding/res.h +34 -0
- data/vendor/lexbor/source/lexbor/encoding/single.c +13748 -0
- data/vendor/lexbor/source/lexbor/encoding/single.h +116 -0
- data/vendor/lexbor/source/lexbor/html/base.h +44 -0
- data/vendor/lexbor/source/lexbor/html/config.cmake +3 -0
- data/vendor/lexbor/source/lexbor/html/encoding.c +574 -0
- data/vendor/lexbor/source/lexbor/html/encoding.h +106 -0
- data/vendor/lexbor/source/lexbor/html/html.h +107 -0
- data/vendor/lexbor/source/lexbor/html/interface.c +165 -0
- data/vendor/lexbor/source/lexbor/html/interface.h +186 -0
- data/vendor/lexbor/source/lexbor/html/interface_res.h +4449 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/anchor_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/anchor_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/area_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/area_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/audio_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/audio_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/base_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/base_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/body_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/body_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/br_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/br_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/button_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/button_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/canvas_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/canvas_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/d_list_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/d_list_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/data_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/data_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/data_list_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/data_list_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/details_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/details_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/dialog_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/dialog_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/directory_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/directory_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/div_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/div_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/document.c +444 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/document.h +256 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/element.c +64 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/element.h +54 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/embed_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/embed_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/field_set_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/field_set_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/font_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/font_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/form_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/form_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/frame_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/frame_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/frame_set_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/frame_set_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/head_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/head_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/heading_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/heading_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/hr_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/hr_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/html_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/html_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/iframe_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/iframe_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/image_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/image_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/input_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/input_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/label_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/label_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/legend_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/legend_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/li_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/li_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/link_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/link_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/map_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/map_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/marquee_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/marquee_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/media_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/media_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/menu_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/menu_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/meta_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/meta_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/meter_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/meter_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/mod_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/mod_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/o_list_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/o_list_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/object_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/object_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/opt_group_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/opt_group_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/option_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/option_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/output_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/output_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/paragraph_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/paragraph_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/param_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/param_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/picture_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/picture_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/pre_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/pre_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/progress_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/progress_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/quote_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/quote_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/script_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/script_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/select_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/select_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/slot_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/slot_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/source_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/source_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/span_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/span_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/style_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/style_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_caption_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_caption_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_cell_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_cell_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_col_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_col_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_row_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_row_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_section_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/table_section_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/template_element.c +46 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/template_element.h +38 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/text_area_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/text_area_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/time_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/time_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/title_element.c +133 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/title_element.h +42 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/track_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/track_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/u_list_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/u_list_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/unknown_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/unknown_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/video_element.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/video_element.h +34 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/window.c +36 -0
- data/vendor/lexbor/source/lexbor/html/interfaces/window.h +34 -0
- data/vendor/lexbor/source/lexbor/html/node.c +14 -0
- data/vendor/lexbor/source/lexbor/html/node.h +67 -0
- data/vendor/lexbor/source/lexbor/html/parser.c +469 -0
- data/vendor/lexbor/source/lexbor/html/parser.h +170 -0
- data/vendor/lexbor/source/lexbor/html/serialize.c +1510 -0
- data/vendor/lexbor/source/lexbor/html/serialize.h +93 -0
- data/vendor/lexbor/source/lexbor/html/tag.h +103 -0
- data/vendor/lexbor/source/lexbor/html/tag_res.h +2262 -0
- data/vendor/lexbor/source/lexbor/html/token.c +386 -0
- data/vendor/lexbor/source/lexbor/html/token.h +130 -0
- data/vendor/lexbor/source/lexbor/html/token_attr.c +44 -0
- data/vendor/lexbor/source/lexbor/html/token_attr.h +67 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/error.c +28 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/error.h +141 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/res.h +4956 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state.c +2171 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state.h +225 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state_comment.c +489 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state_comment.h +27 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state_doctype.c +1654 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state_doctype.h +27 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state_rawtext.c +303 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state_rawtext.h +32 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state_rcdata.c +311 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state_rcdata.h +32 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state_script.c +1209 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer/state_script.h +32 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer.c +499 -0
- data/vendor/lexbor/source/lexbor/html/tokenizer.h +343 -0
- data/vendor/lexbor/source/lexbor/html/tree/active_formatting.c +241 -0
- data/vendor/lexbor/source/lexbor/html/tree/active_formatting.h +117 -0
- data/vendor/lexbor/source/lexbor/html/tree/error.c +26 -0
- data/vendor/lexbor/source/lexbor/html/tree/error.h +114 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_after_body.c +62 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_after_frameset.c +63 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_body.c +82 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_frameset.c +88 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/after_head.c +222 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/before_head.c +144 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/before_html.c +166 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/foreign_content.c +358 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_body.c +1974 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_caption.c +158 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_cell.c +187 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_column_group.c +194 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_frameset.c +149 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_head.c +374 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_head_noscript.c +121 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_row.c +211 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_select.c +341 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_select_in_table.c +115 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_table.c +451 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_table_body.c +208 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_table_text.c +127 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/in_template.c +189 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/initial.c +411 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode/text.c +61 -0
- data/vendor/lexbor/source/lexbor/html/tree/insertion_mode.h +135 -0
- data/vendor/lexbor/source/lexbor/html/tree/open_elements.c +251 -0
- data/vendor/lexbor/source/lexbor/html/tree/open_elements.h +105 -0
- data/vendor/lexbor/source/lexbor/html/tree/template_insertion.c +10 -0
- data/vendor/lexbor/source/lexbor/html/tree/template_insertion.h +100 -0
- data/vendor/lexbor/source/lexbor/html/tree.c +1726 -0
- data/vendor/lexbor/source/lexbor/html/tree.h +431 -0
- data/vendor/lexbor/source/lexbor/html/tree_res.h +111 -0
- data/vendor/lexbor/source/lexbor/ns/base.h +32 -0
- data/vendor/lexbor/source/lexbor/ns/config.cmake +2 -0
- data/vendor/lexbor/source/lexbor/ns/const.h +37 -0
- data/vendor/lexbor/source/lexbor/ns/ns.c +154 -0
- data/vendor/lexbor/source/lexbor/ns/ns.h +66 -0
- data/vendor/lexbor/source/lexbor/ns/res.h +97 -0
- data/vendor/lexbor/source/lexbor/ports/posix/config.cmake +11 -0
- data/vendor/lexbor/source/lexbor/ports/posix/lexbor/core/fs.c +236 -0
- data/vendor/lexbor/source/lexbor/ports/posix/lexbor/core/memory.c +33 -0
- data/vendor/lexbor/source/lexbor/ports/posix/lexbor/core/perf.c +158 -0
- data/vendor/lexbor/source/lexbor/ports/windows_nt/config.cmake +18 -0
- data/vendor/lexbor/source/lexbor/ports/windows_nt/lexbor/core/fs.c +239 -0
- data/vendor/lexbor/source/lexbor/ports/windows_nt/lexbor/core/memory.c +33 -0
- data/vendor/lexbor/source/lexbor/ports/windows_nt/lexbor/core/perf.c +81 -0
- data/vendor/lexbor/source/lexbor/selectors/base.h +30 -0
- data/vendor/lexbor/source/lexbor/selectors/config.cmake +2 -0
- data/vendor/lexbor/source/lexbor/selectors/selectors.c +1591 -0
- data/vendor/lexbor/source/lexbor/selectors/selectors.h +71 -0
- data/vendor/lexbor/source/lexbor/tag/base.h +32 -0
- data/vendor/lexbor/source/lexbor/tag/config.cmake +2 -0
- data/vendor/lexbor/source/lexbor/tag/const.h +225 -0
- data/vendor/lexbor/source/lexbor/tag/res.h +562 -0
- data/vendor/lexbor/source/lexbor/tag/tag.c +144 -0
- data/vendor/lexbor/source/lexbor/tag/tag.h +123 -0
- data/vendor/lexbor/source/lexbor/utils/base.h +32 -0
- data/vendor/lexbor/source/lexbor/utils/config.cmake +2 -0
- data/vendor/lexbor/source/lexbor/utils/http.c +534 -0
- data/vendor/lexbor/source/lexbor/utils/http.h +90 -0
- data/vendor/lexbor/source/lexbor/utils/utils.h +15 -0
- data/vendor/lexbor/source/lexbor/utils/warc.c +817 -0
- data/vendor/lexbor/source/lexbor/utils/warc.h +126 -0
- data/vendor/lexbor/utils/lexbor/css/selectors/pseudo.py +231 -0
- data/vendor/lexbor/utils/lexbor/css/selectors/tmp/const.h +21 -0
- data/vendor/lexbor/utils/lexbor/css/selectors/tmp/res.h +26 -0
- data/vendor/lexbor/utils/lexbor/css/syntax/definitions.py +49 -0
- data/vendor/lexbor/utils/lexbor/css/syntax/token_res.py +54 -0
- data/vendor/lexbor/utils/lexbor/css/syntax/tokenizer_code_map.py +36 -0
- data/vendor/lexbor/version +1 -0
- metadata +542 -0
@@ -0,0 +1,411 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) 2018-2020 Alexander Borisov
|
3
|
+
*
|
4
|
+
* Author: Alexander Borisov <borisov@lexbor.com>
|
5
|
+
*/
|
6
|
+
|
7
|
+
#include "lexbor/html/tree/insertion_mode.h"
|
8
|
+
#include "lexbor/dom/interfaces/document_type.h"
|
9
|
+
|
10
|
+
|
11
|
+
typedef struct {
|
12
|
+
const char *data;
|
13
|
+
size_t len;
|
14
|
+
}
|
15
|
+
lxb_html_tree_insertion_mode_initial_str_t;
|
16
|
+
|
17
|
+
|
18
|
+
static lxb_html_tree_insertion_mode_initial_str_t
|
19
|
+
lxb_html_tree_insertion_mode_initial_doctype_public_is[] =
|
20
|
+
{
|
21
|
+
{"-//W3O//DTD W3 HTML Strict 3.0//EN//", 36},
|
22
|
+
{"-/W3C/DTD HTML 4.0 Transitional/EN", 34},
|
23
|
+
{"HTML", 4}
|
24
|
+
};
|
25
|
+
|
26
|
+
static lxb_html_tree_insertion_mode_initial_str_t
|
27
|
+
lxb_html_tree_insertion_mode_initial_doctype_system_is[] =
|
28
|
+
{
|
29
|
+
{"http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd", 58}
|
30
|
+
};
|
31
|
+
|
32
|
+
static lxb_html_tree_insertion_mode_initial_str_t
|
33
|
+
lxb_html_tree_insertion_mode_initial_doctype_public_start[] =
|
34
|
+
{
|
35
|
+
{"+//Silmaril//dtd html Pro v0r11 19970101//", 42},
|
36
|
+
{"-//AS//DTD HTML 3.0 asWedit + extensions//", 42},
|
37
|
+
{"-//AdvaSoft Ltd//DTD HTML 3.0 asWedit + extensions//", 52},
|
38
|
+
{"-//IETF//DTD HTML 2.0 Level 1//", 31},
|
39
|
+
{"-//IETF//DTD HTML 2.0 Level 2//", 31},
|
40
|
+
{"-//IETF//DTD HTML 2.0 Strict Level 1//", 38},
|
41
|
+
{"-//IETF//DTD HTML 2.0 Strict Level 2//", 38},
|
42
|
+
{"-//IETF//DTD HTML 2.0 Strict//", 30},
|
43
|
+
{"-//IETF//DTD HTML 2.0//", 23},
|
44
|
+
{"-//IETF//DTD HTML 2.1E//", 24},
|
45
|
+
{"-//IETF//DTD HTML 3.0//", 23},
|
46
|
+
{"-//IETF//DTD HTML 3.2 Final//", 29},
|
47
|
+
{"-//IETF//DTD HTML 3.2//", 23},
|
48
|
+
{"-//IETF//DTD HTML 3//", 21},
|
49
|
+
{"-//IETF//DTD HTML Level 0//", 27},
|
50
|
+
{"-//IETF//DTD HTML Level 1//", 27},
|
51
|
+
{"-//IETF//DTD HTML Level 2//", 27},
|
52
|
+
{"-//IETF//DTD HTML Level 3//", 27},
|
53
|
+
{"-//IETF//DTD HTML Strict Level 0//", 34},
|
54
|
+
{"-//IETF//DTD HTML Strict Level 1//", 34},
|
55
|
+
{"-//IETF//DTD HTML Strict Level 2//", 34},
|
56
|
+
{"-//IETF//DTD HTML Strict Level 3//", 34},
|
57
|
+
{"-//IETF//DTD HTML Strict//", 26},
|
58
|
+
{"-//IETF//DTD HTML//", 19},
|
59
|
+
{"-//Metrius//DTD Metrius Presentational//", 40},
|
60
|
+
{"-//Microsoft//DTD Internet Explorer 2.0 HTML Strict//", 53},
|
61
|
+
{"-//Microsoft//DTD Internet Explorer 2.0 HTML//", 46},
|
62
|
+
{"-//Microsoft//DTD Internet Explorer 2.0 Tables//", 48},
|
63
|
+
{"-//Microsoft//DTD Internet Explorer 3.0 HTML Strict//", 53},
|
64
|
+
{"-//Microsoft//DTD Internet Explorer 3.0 HTML//", 46},
|
65
|
+
{"-//Microsoft//DTD Internet Explorer 3.0 Tables//", 48},
|
66
|
+
{"-//Netscape Comm. Corp.//DTD HTML//", 35},
|
67
|
+
{"-//Netscape Comm. Corp.//DTD Strict HTML//", 42},
|
68
|
+
{"-//O'Reilly and Associates//DTD HTML 2.0//", 42},
|
69
|
+
{"-//O'Reilly and Associates//DTD HTML Extended 1.0//", 51},
|
70
|
+
{"-//O'Reilly and Associates//DTD HTML Extended Relaxed 1.0//", 59},
|
71
|
+
{"-//SQ//DTD HTML 2.0 HoTMetaL + extensions//", 43},
|
72
|
+
{"-//SoftQuad Software//DTD HoTMetaL PRO 6.0::19990601::extensions to HTML 4.0//", 78},
|
73
|
+
{"-//SoftQuad//DTD HoTMetaL PRO 4.0::19971010::extensions to HTML 4.0//", 69},
|
74
|
+
{"-//Spyglass//DTD HTML 2.0 Extended//", 36},
|
75
|
+
{"-//Sun Microsystems Corp.//DTD HotJava HTML//", 45},
|
76
|
+
{"-//Sun Microsystems Corp.//DTD HotJava Strict HTML//", 52},
|
77
|
+
{"-//W3C//DTD HTML 3 1995-03-24//", 31},
|
78
|
+
{"-//W3C//DTD HTML 3.2 Draft//", 28},
|
79
|
+
{"-//W3C//DTD HTML 3.2 Final//", 28},
|
80
|
+
{"-//W3C//DTD HTML 3.2//", 22},
|
81
|
+
{"-//W3C//DTD HTML 3.2S Draft//", 29},
|
82
|
+
{"-//W3C//DTD HTML 4.0 Frameset//", 31},
|
83
|
+
{"-//W3C//DTD HTML 4.0 Transitional//", 35},
|
84
|
+
{"-//W3C//DTD HTML Experimental 19960712//", 40},
|
85
|
+
{"-//W3C//DTD HTML Experimental 970421//", 38},
|
86
|
+
{"-//W3C//DTD W3 HTML//", 21},
|
87
|
+
{"-//W3O//DTD W3 HTML 3.0//", 25},
|
88
|
+
{"-//WebTechs//DTD Mozilla HTML 2.0//", 35},
|
89
|
+
{"-//WebTechs//DTD Mozilla HTML//", 31}
|
90
|
+
};
|
91
|
+
|
92
|
+
static lxb_html_tree_insertion_mode_initial_str_t
|
93
|
+
lxb_html_tree_insertion_mode_initial_doctype_sys_pub_start[] =
|
94
|
+
{
|
95
|
+
{"-//W3C//DTD HTML 4.01 Frameset//", 32},
|
96
|
+
{"-//W3C//DTD HTML 4.01 Transitional//", 36}
|
97
|
+
};
|
98
|
+
|
99
|
+
static lxb_html_tree_insertion_mode_initial_str_t
|
100
|
+
lxb_html_tree_insertion_mode_initial_doctype_lim_pub_start[] =
|
101
|
+
{
|
102
|
+
{"-//W3C//DTD XHTML 1.0 Frameset//", 32},
|
103
|
+
{"-//W3C//DTD XHTML 1.0 Transitional//", 36}
|
104
|
+
};
|
105
|
+
|
106
|
+
|
107
|
+
static bool
|
108
|
+
lxb_html_tree_insertion_mode_initial_doctype(lxb_html_tree_t *tree,
|
109
|
+
lxb_html_token_t *token);
|
110
|
+
|
111
|
+
static void
|
112
|
+
lxb_html_tree_insertion_mode_initial_doctype_ckeck(lxb_html_tree_t *tree,
|
113
|
+
lxb_dom_document_type_t *doc_type,
|
114
|
+
lxb_html_token_t *token, bool is_html);
|
115
|
+
|
116
|
+
static bool
|
117
|
+
lxb_html_tree_insertion_mode_initial_doctype_ckeck_public(
|
118
|
+
lxb_dom_document_type_t *doc_type);
|
119
|
+
|
120
|
+
static bool
|
121
|
+
lxb_html_tree_insertion_mode_initial_doctype_ckeck_system(
|
122
|
+
lxb_dom_document_type_t *doc_type);
|
123
|
+
|
124
|
+
static bool
|
125
|
+
lxb_html_tree_insertion_mode_initial_doctype_ckeck_pubsys(
|
126
|
+
lxb_dom_document_type_t *doc_type);
|
127
|
+
|
128
|
+
static bool
|
129
|
+
lxb_html_tree_insertion_mode_initial_doctype_check_limq(
|
130
|
+
lxb_dom_document_type_t *doc_type);
|
131
|
+
|
132
|
+
|
133
|
+
bool
|
134
|
+
lxb_html_tree_insertion_mode_initial(lxb_html_tree_t *tree,
|
135
|
+
lxb_html_token_t *token)
|
136
|
+
{
|
137
|
+
switch (token->tag_id) {
|
138
|
+
case LXB_TAG__EM_COMMENT: {
|
139
|
+
lxb_dom_comment_t *comment;
|
140
|
+
|
141
|
+
comment = lxb_html_tree_insert_comment(tree, token,
|
142
|
+
lxb_dom_interface_node(tree->document));
|
143
|
+
if (comment == NULL) {
|
144
|
+
return lxb_html_tree_process_abort(tree);
|
145
|
+
}
|
146
|
+
|
147
|
+
break;
|
148
|
+
}
|
149
|
+
|
150
|
+
case LXB_TAG__EM_DOCTYPE:
|
151
|
+
tree->mode = lxb_html_tree_insertion_mode_before_html;
|
152
|
+
|
153
|
+
return lxb_html_tree_insertion_mode_initial_doctype(tree, token);
|
154
|
+
|
155
|
+
case LXB_TAG__TEXT:
|
156
|
+
tree->status = lxb_html_token_data_skip_ws_begin(token);
|
157
|
+
if (tree->status != LXB_STATUS_OK) {
|
158
|
+
return lxb_html_tree_process_abort(tree);
|
159
|
+
}
|
160
|
+
|
161
|
+
if (token->text_start == token->text_end) {
|
162
|
+
return true;
|
163
|
+
}
|
164
|
+
/* fall through */
|
165
|
+
|
166
|
+
default: {
|
167
|
+
lxb_dom_document_t *document = &tree->document->dom_document;
|
168
|
+
|
169
|
+
if (tree->document->iframe_srcdoc == NULL) {
|
170
|
+
lxb_html_tree_parse_error(tree, token,
|
171
|
+
LXB_HTML_RULES_ERROR_UNTOININMO);
|
172
|
+
|
173
|
+
document->compat_mode = LXB_DOM_DOCUMENT_CMODE_QUIRKS;
|
174
|
+
}
|
175
|
+
|
176
|
+
tree->mode = lxb_html_tree_insertion_mode_before_html;
|
177
|
+
|
178
|
+
return false;
|
179
|
+
}
|
180
|
+
}
|
181
|
+
|
182
|
+
return true;
|
183
|
+
}
|
184
|
+
|
185
|
+
static bool
|
186
|
+
lxb_html_tree_insertion_mode_initial_doctype(lxb_html_tree_t *tree,
|
187
|
+
lxb_html_token_t *token)
|
188
|
+
{
|
189
|
+
lxb_dom_document_type_t *doc_type;
|
190
|
+
|
191
|
+
/* Create */
|
192
|
+
doc_type = lxb_html_tree_create_document_type_from_token(tree, token);
|
193
|
+
if (doc_type == NULL) {
|
194
|
+
tree->status = LXB_STATUS_ERROR_MEMORY_ALLOCATION;
|
195
|
+
|
196
|
+
return lxb_html_tree_process_abort(tree);
|
197
|
+
}
|
198
|
+
|
199
|
+
/* Check */
|
200
|
+
bool is_html = (doc_type->name == LXB_DOM_ATTR_HTML);
|
201
|
+
|
202
|
+
if (is_html == false
|
203
|
+
|| doc_type->public_id.length != 0
|
204
|
+
|| (doc_type->system_id.length == 19
|
205
|
+
&& strncmp("about:legacy-compat",
|
206
|
+
(const char *) doc_type->system_id.data, 19) != 0)
|
207
|
+
)
|
208
|
+
{
|
209
|
+
lxb_html_tree_parse_error(tree, token,
|
210
|
+
LXB_HTML_RULES_ERROR_BADOTOININMO);
|
211
|
+
}
|
212
|
+
|
213
|
+
lxb_html_tree_insertion_mode_initial_doctype_ckeck(tree, doc_type,
|
214
|
+
token, is_html);
|
215
|
+
|
216
|
+
lxb_dom_node_insert_child(&tree->document->dom_document.node,
|
217
|
+
lxb_dom_interface_node(doc_type));
|
218
|
+
|
219
|
+
lxb_dom_document_attach_doctype(&tree->document->dom_document, doc_type);
|
220
|
+
|
221
|
+
return true;
|
222
|
+
}
|
223
|
+
|
224
|
+
static void
|
225
|
+
lxb_html_tree_insertion_mode_initial_doctype_ckeck(lxb_html_tree_t *tree,
|
226
|
+
lxb_dom_document_type_t *doc_type,
|
227
|
+
lxb_html_token_t *token, bool is_html)
|
228
|
+
{
|
229
|
+
if (tree->document->iframe_srcdoc != NULL) {
|
230
|
+
return;
|
231
|
+
}
|
232
|
+
|
233
|
+
bool quirks;
|
234
|
+
lxb_dom_document_t *document = &tree->document->dom_document;
|
235
|
+
|
236
|
+
if (token->type & LXB_HTML_TOKEN_TYPE_FORCE_QUIRKS) {
|
237
|
+
goto set_quirks;
|
238
|
+
}
|
239
|
+
|
240
|
+
if (is_html == false) {
|
241
|
+
goto set_quirks;
|
242
|
+
}
|
243
|
+
|
244
|
+
if (doc_type->public_id.length != 0) {
|
245
|
+
quirks =
|
246
|
+
lxb_html_tree_insertion_mode_initial_doctype_ckeck_public(doc_type);
|
247
|
+
|
248
|
+
if (quirks) {
|
249
|
+
goto set_quirks;
|
250
|
+
}
|
251
|
+
}
|
252
|
+
|
253
|
+
if (doc_type->system_id.length != 0) {
|
254
|
+
quirks =
|
255
|
+
lxb_html_tree_insertion_mode_initial_doctype_ckeck_system(doc_type);
|
256
|
+
|
257
|
+
if (quirks) {
|
258
|
+
goto set_quirks;
|
259
|
+
}
|
260
|
+
}
|
261
|
+
|
262
|
+
if (doc_type->public_id.length != 0 && doc_type->system_id.length == 0) {
|
263
|
+
quirks =
|
264
|
+
lxb_html_tree_insertion_mode_initial_doctype_ckeck_pubsys(doc_type);
|
265
|
+
|
266
|
+
if (quirks) {
|
267
|
+
goto set_quirks;
|
268
|
+
}
|
269
|
+
}
|
270
|
+
|
271
|
+
if (doc_type->public_id.length != 0) {
|
272
|
+
quirks =
|
273
|
+
lxb_html_tree_insertion_mode_initial_doctype_check_limq(doc_type);
|
274
|
+
|
275
|
+
if (quirks) {
|
276
|
+
document->compat_mode = LXB_DOM_DOCUMENT_CMODE_LIMITED_QUIRKS;
|
277
|
+
return;
|
278
|
+
}
|
279
|
+
}
|
280
|
+
|
281
|
+
return;
|
282
|
+
|
283
|
+
set_quirks:
|
284
|
+
|
285
|
+
document->compat_mode = LXB_DOM_DOCUMENT_CMODE_QUIRKS;
|
286
|
+
}
|
287
|
+
|
288
|
+
static bool
|
289
|
+
lxb_html_tree_insertion_mode_initial_doctype_ckeck_public(
|
290
|
+
lxb_dom_document_type_t *doc_type)
|
291
|
+
{
|
292
|
+
size_t size, i;
|
293
|
+
lxb_html_tree_insertion_mode_initial_str_t *str;
|
294
|
+
|
295
|
+
/* The public identifier is set to */
|
296
|
+
size = sizeof(lxb_html_tree_insertion_mode_initial_doctype_public_is)
|
297
|
+
/ sizeof(lxb_html_tree_insertion_mode_initial_str_t);
|
298
|
+
|
299
|
+
for (i = 0; i < size; i++) {
|
300
|
+
str = &lxb_html_tree_insertion_mode_initial_doctype_public_is[i];
|
301
|
+
|
302
|
+
if (str->len == doc_type->public_id.length
|
303
|
+
&& lexbor_str_data_casecmp((const lxb_char_t *) str->data,
|
304
|
+
doc_type->public_id.data))
|
305
|
+
{
|
306
|
+
return true;
|
307
|
+
}
|
308
|
+
}
|
309
|
+
|
310
|
+
/* The public identifier starts with */
|
311
|
+
size = sizeof(lxb_html_tree_insertion_mode_initial_doctype_public_start)
|
312
|
+
/ sizeof(lxb_html_tree_insertion_mode_initial_str_t);
|
313
|
+
|
314
|
+
for (i = 0; i < size; i++) {
|
315
|
+
str = &lxb_html_tree_insertion_mode_initial_doctype_public_start[i];
|
316
|
+
|
317
|
+
if (str->len <= doc_type->public_id.length
|
318
|
+
&& lexbor_str_data_ncasecmp((const lxb_char_t *) str->data,
|
319
|
+
doc_type->public_id.data, str->len))
|
320
|
+
{
|
321
|
+
return true;
|
322
|
+
}
|
323
|
+
}
|
324
|
+
|
325
|
+
return false;
|
326
|
+
}
|
327
|
+
|
328
|
+
static bool
|
329
|
+
lxb_html_tree_insertion_mode_initial_doctype_ckeck_system(
|
330
|
+
lxb_dom_document_type_t *doc_type)
|
331
|
+
{
|
332
|
+
size_t size;
|
333
|
+
lxb_html_tree_insertion_mode_initial_str_t *str;
|
334
|
+
|
335
|
+
/* The system identifier is set to */
|
336
|
+
size = sizeof(lxb_html_tree_insertion_mode_initial_doctype_system_is)
|
337
|
+
/ sizeof(lxb_html_tree_insertion_mode_initial_str_t);
|
338
|
+
|
339
|
+
for (size_t i = 0; i < size; i++) {
|
340
|
+
str = &lxb_html_tree_insertion_mode_initial_doctype_system_is[i];
|
341
|
+
|
342
|
+
if (str->len == doc_type->system_id.length
|
343
|
+
&& lexbor_str_data_casecmp((const lxb_char_t *) str->data,
|
344
|
+
doc_type->system_id.data))
|
345
|
+
{
|
346
|
+
return true;
|
347
|
+
}
|
348
|
+
}
|
349
|
+
|
350
|
+
return false;
|
351
|
+
}
|
352
|
+
|
353
|
+
static bool
|
354
|
+
lxb_html_tree_insertion_mode_initial_doctype_ckeck_pubsys(
|
355
|
+
lxb_dom_document_type_t *doc_type)
|
356
|
+
{
|
357
|
+
size_t size;
|
358
|
+
lxb_html_tree_insertion_mode_initial_str_t *str;
|
359
|
+
|
360
|
+
/* The system identifier is missing and the public identifier starts with */
|
361
|
+
size = sizeof(lxb_html_tree_insertion_mode_initial_doctype_sys_pub_start)
|
362
|
+
/ sizeof(lxb_html_tree_insertion_mode_initial_str_t);
|
363
|
+
|
364
|
+
for (size_t i = 0; i < size; i++) {
|
365
|
+
str = &lxb_html_tree_insertion_mode_initial_doctype_sys_pub_start[i];
|
366
|
+
|
367
|
+
if (str->len <= doc_type->public_id.length
|
368
|
+
&& lexbor_str_data_ncasecmp((const lxb_char_t *) str->data,
|
369
|
+
doc_type->public_id.data, str->len))
|
370
|
+
{
|
371
|
+
return true;
|
372
|
+
}
|
373
|
+
}
|
374
|
+
|
375
|
+
return false;
|
376
|
+
}
|
377
|
+
|
378
|
+
static bool
|
379
|
+
lxb_html_tree_insertion_mode_initial_doctype_check_limq(
|
380
|
+
lxb_dom_document_type_t *doc_type)
|
381
|
+
{
|
382
|
+
bool quirks;
|
383
|
+
size_t size;
|
384
|
+
lxb_html_tree_insertion_mode_initial_str_t *str;
|
385
|
+
|
386
|
+
if (doc_type->system_id.length != 0) {
|
387
|
+
quirks =
|
388
|
+
lxb_html_tree_insertion_mode_initial_doctype_ckeck_pubsys(doc_type);
|
389
|
+
|
390
|
+
if (quirks) {
|
391
|
+
return true;
|
392
|
+
}
|
393
|
+
}
|
394
|
+
|
395
|
+
/* The public identifier starts with */
|
396
|
+
size = sizeof(lxb_html_tree_insertion_mode_initial_doctype_lim_pub_start)
|
397
|
+
/ sizeof(lxb_html_tree_insertion_mode_initial_str_t);
|
398
|
+
|
399
|
+
for (size_t i = 0; i < size; i++) {
|
400
|
+
str = &lxb_html_tree_insertion_mode_initial_doctype_lim_pub_start[i];
|
401
|
+
|
402
|
+
if (str->len <= doc_type->public_id.length
|
403
|
+
&& lexbor_str_data_ncasecmp((const lxb_char_t *) str->data,
|
404
|
+
doc_type->public_id.data, str->len))
|
405
|
+
{
|
406
|
+
return true;
|
407
|
+
}
|
408
|
+
}
|
409
|
+
|
410
|
+
return false;
|
411
|
+
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) 2018 Alexander Borisov
|
3
|
+
*
|
4
|
+
* Author: Alexander Borisov <borisov@lexbor.com>
|
5
|
+
*/
|
6
|
+
|
7
|
+
#include "lexbor/html/tree/insertion_mode.h"
|
8
|
+
#include "lexbor/html/tree/open_elements.h"
|
9
|
+
|
10
|
+
|
11
|
+
bool
|
12
|
+
lxb_html_tree_insertion_mode_text(lxb_html_tree_t *tree,
|
13
|
+
lxb_html_token_t *token)
|
14
|
+
{
|
15
|
+
switch (token->tag_id) {
|
16
|
+
case LXB_TAG__TEXT: {
|
17
|
+
tree->status = lxb_html_tree_insert_character(tree, token, NULL);
|
18
|
+
if (tree->status != LXB_STATUS_OK) {
|
19
|
+
return lxb_html_tree_process_abort(tree);
|
20
|
+
}
|
21
|
+
|
22
|
+
break;
|
23
|
+
}
|
24
|
+
|
25
|
+
case LXB_TAG__END_OF_FILE: {
|
26
|
+
lxb_dom_node_t *node;
|
27
|
+
|
28
|
+
lxb_html_tree_parse_error(tree, token,
|
29
|
+
LXB_HTML_RULES_ERROR_UNENOFFI);
|
30
|
+
|
31
|
+
node = lxb_html_tree_current_node(tree);
|
32
|
+
|
33
|
+
if (lxb_html_tree_node_is(node, LXB_TAG_SCRIPT)) {
|
34
|
+
/* TODO: mark the script element as "already started" */
|
35
|
+
}
|
36
|
+
|
37
|
+
lxb_html_tree_open_elements_pop(tree);
|
38
|
+
|
39
|
+
tree->mode = tree->original_mode;
|
40
|
+
|
41
|
+
return false;
|
42
|
+
}
|
43
|
+
|
44
|
+
/* TODO: need to implement */
|
45
|
+
case LXB_TAG_SCRIPT:
|
46
|
+
lxb_html_tree_open_elements_pop(tree);
|
47
|
+
|
48
|
+
tree->mode = tree->original_mode;
|
49
|
+
|
50
|
+
break;
|
51
|
+
|
52
|
+
default:
|
53
|
+
lxb_html_tree_open_elements_pop(tree);
|
54
|
+
|
55
|
+
tree->mode = tree->original_mode;
|
56
|
+
|
57
|
+
break;
|
58
|
+
}
|
59
|
+
|
60
|
+
return true;
|
61
|
+
}
|
@@ -0,0 +1,135 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) 2018 Alexander Borisov
|
3
|
+
*
|
4
|
+
* Author: Alexander Borisov <borisov@lexbor.com>
|
5
|
+
*/
|
6
|
+
|
7
|
+
#ifndef LEXBOR_HTML_TREE_INSERTION_MODE_H
|
8
|
+
#define LEXBOR_HTML_TREE_INSERTION_MODE_H
|
9
|
+
|
10
|
+
#ifdef __cplusplus
|
11
|
+
extern "C" {
|
12
|
+
#endif
|
13
|
+
|
14
|
+
#include "lexbor/html/token.h"
|
15
|
+
#include "lexbor/html/tree.h"
|
16
|
+
|
17
|
+
|
18
|
+
LXB_API bool
|
19
|
+
lxb_html_tree_insertion_mode_initial(lxb_html_tree_t *tree,
|
20
|
+
lxb_html_token_t *token);
|
21
|
+
|
22
|
+
LXB_API bool
|
23
|
+
lxb_html_tree_insertion_mode_before_html(lxb_html_tree_t *tree,
|
24
|
+
lxb_html_token_t *token);
|
25
|
+
|
26
|
+
LXB_API bool
|
27
|
+
lxb_html_tree_insertion_mode_before_head(lxb_html_tree_t *tree,
|
28
|
+
lxb_html_token_t *token);
|
29
|
+
|
30
|
+
LXB_API bool
|
31
|
+
lxb_html_tree_insertion_mode_in_head(lxb_html_tree_t *tree,
|
32
|
+
lxb_html_token_t *token);
|
33
|
+
|
34
|
+
LXB_API bool
|
35
|
+
lxb_html_tree_insertion_mode_in_head_noscript(lxb_html_tree_t *tree,
|
36
|
+
lxb_html_token_t *token);
|
37
|
+
|
38
|
+
LXB_API bool
|
39
|
+
lxb_html_tree_insertion_mode_after_head(lxb_html_tree_t *tree,
|
40
|
+
lxb_html_token_t *token);
|
41
|
+
|
42
|
+
LXB_API bool
|
43
|
+
lxb_html_tree_insertion_mode_in_body(lxb_html_tree_t *tree,
|
44
|
+
lxb_html_token_t *token);
|
45
|
+
|
46
|
+
LXB_API bool
|
47
|
+
lxb_html_tree_insertion_mode_in_body_skip_new_line(lxb_html_tree_t *tree,
|
48
|
+
lxb_html_token_t *token);
|
49
|
+
|
50
|
+
LXB_API bool
|
51
|
+
lxb_html_tree_insertion_mode_in_body_skip_new_line_textarea(lxb_html_tree_t *tree,
|
52
|
+
lxb_html_token_t *token);
|
53
|
+
|
54
|
+
LXB_API lxb_status_t
|
55
|
+
lxb_html_tree_insertion_mode_in_body_text_append(lxb_html_tree_t *tree,
|
56
|
+
lexbor_str_t *str);
|
57
|
+
|
58
|
+
LXB_API bool
|
59
|
+
lxb_html_tree_insertion_mode_text(lxb_html_tree_t *tree,
|
60
|
+
lxb_html_token_t *token);
|
61
|
+
|
62
|
+
LXB_API bool
|
63
|
+
lxb_html_tree_insertion_mode_in_table(lxb_html_tree_t *tree,
|
64
|
+
lxb_html_token_t *token);
|
65
|
+
|
66
|
+
LXB_API bool
|
67
|
+
lxb_html_tree_insertion_mode_in_table_anything_else(lxb_html_tree_t *tree,
|
68
|
+
lxb_html_token_t *token);
|
69
|
+
|
70
|
+
LXB_API bool
|
71
|
+
lxb_html_tree_insertion_mode_in_table_text(lxb_html_tree_t *tree,
|
72
|
+
lxb_html_token_t *token);
|
73
|
+
|
74
|
+
LXB_API bool
|
75
|
+
lxb_html_tree_insertion_mode_in_caption(lxb_html_tree_t *tree,
|
76
|
+
lxb_html_token_t *token);
|
77
|
+
|
78
|
+
LXB_API bool
|
79
|
+
lxb_html_tree_insertion_mode_in_column_group(lxb_html_tree_t *tree,
|
80
|
+
lxb_html_token_t *token);
|
81
|
+
|
82
|
+
LXB_API bool
|
83
|
+
lxb_html_tree_insertion_mode_in_table_body(lxb_html_tree_t *tree,
|
84
|
+
lxb_html_token_t *token);
|
85
|
+
|
86
|
+
LXB_API bool
|
87
|
+
lxb_html_tree_insertion_mode_in_row(lxb_html_tree_t *tree,
|
88
|
+
lxb_html_token_t *token);
|
89
|
+
|
90
|
+
LXB_API bool
|
91
|
+
lxb_html_tree_insertion_mode_in_cell(lxb_html_tree_t *tree,
|
92
|
+
lxb_html_token_t *token);
|
93
|
+
|
94
|
+
LXB_API bool
|
95
|
+
lxb_html_tree_insertion_mode_in_select(lxb_html_tree_t *tree,
|
96
|
+
lxb_html_token_t *token);
|
97
|
+
|
98
|
+
LXB_API bool
|
99
|
+
lxb_html_tree_insertion_mode_in_select_in_table(lxb_html_tree_t *tree,
|
100
|
+
lxb_html_token_t *token);
|
101
|
+
|
102
|
+
LXB_API bool
|
103
|
+
lxb_html_tree_insertion_mode_in_template(lxb_html_tree_t *tree,
|
104
|
+
lxb_html_token_t *token);
|
105
|
+
|
106
|
+
LXB_API bool
|
107
|
+
lxb_html_tree_insertion_mode_after_body(lxb_html_tree_t *tree,
|
108
|
+
lxb_html_token_t *token);
|
109
|
+
|
110
|
+
LXB_API bool
|
111
|
+
lxb_html_tree_insertion_mode_in_frameset(lxb_html_tree_t *tree,
|
112
|
+
lxb_html_token_t *token);
|
113
|
+
|
114
|
+
LXB_API bool
|
115
|
+
lxb_html_tree_insertion_mode_after_frameset(lxb_html_tree_t *tree,
|
116
|
+
lxb_html_token_t *token);
|
117
|
+
|
118
|
+
LXB_API bool
|
119
|
+
lxb_html_tree_insertion_mode_after_after_body(lxb_html_tree_t *tree,
|
120
|
+
lxb_html_token_t *token);
|
121
|
+
|
122
|
+
LXB_API bool
|
123
|
+
lxb_html_tree_insertion_mode_after_after_frameset(lxb_html_tree_t *tree,
|
124
|
+
lxb_html_token_t *token);
|
125
|
+
|
126
|
+
LXB_API bool
|
127
|
+
lxb_html_tree_insertion_mode_foreign_content(lxb_html_tree_t *tree,
|
128
|
+
lxb_html_token_t *token);
|
129
|
+
|
130
|
+
|
131
|
+
#ifdef __cplusplus
|
132
|
+
} /* extern "C" */
|
133
|
+
#endif
|
134
|
+
|
135
|
+
#endif /* LEXBOR_HTML_TREE_INSERTION_MODE_H */
|