@@ -219,7 +219,14 @@ cdef extern from "lexbor/html/html.h" nogil:
219219
220220 # Functions
221221 lxb_html_document_t * lxb_html_document_create()
222- lxb_status_t lxb_html_document_parse(lxb_html_document_t * document, const lxb_char_t * html, size_t size)
222+ lxb_html_element_t * lxb_html_document_create_element(lxb_html_document_t * document,
223+ const lxb_char_t * local_name, size_t lname_len,
224+ void * reserved_for_opt)
225+ lxb_status_t lxb_html_document_parse(lxb_html_document_t * document, const lxb_char_t * html, size_t size)
226+ lxb_dom_node_t * lxb_html_document_parse_fragment(lxb_html_document_t * document,
227+ lxb_dom_element_t * element,
228+ const lxb_char_t * html,
229+ size_t size)
223230 lxb_html_body_element_t * lxb_html_document_body_element_noi(lxb_html_document_t * document)
224231 lxb_html_head_element_t * lxb_html_document_head_element_noi(lxb_html_document_t * document)
225232 lxb_dom_element_t * lxb_dom_document_element(lxb_dom_document_t * document)
@@ -254,9 +261,13 @@ cdef class LexborCSSSelector:
254261
255262cdef class LexborHTMLParser:
256263 cdef lxb_html_document_t * document
264+ cdef bint _is_fragment
257265 cdef public bytes raw_html
258266 cdef LexborCSSSelector _selector
259- cdef int _parse_html(self , char * html, size_t html_len) except - 1
267+ cdef inline void _new_html_document(self )
268+ cdef inline lxb_status_t _parse_html_document(self , char * html, size_t html_len) nogil
269+ cdef inline lxb_status_t _parse_html_fragment(self , char * html, size_t html_len) nogil
270+ cdef int _parse_html(self , char * html, size_t html_len) except - 1
260271 cdef object cached_script_texts
261272 cdef object cached_script_srcs
262273
@@ -304,6 +315,7 @@ cdef extern from "lexbor/dom/dom.h" nogil:
304315 void lxb_dom_node_remove(lxb_dom_node_t * node)
305316 void * lxb_dom_document_destroy_text_noi(lxb_dom_document_t * document, lxb_char_t * text)
306317 lxb_dom_node_t * lxb_dom_document_root(lxb_dom_document_t * document)
318+ lxb_dom_element_t * lxb_dom_interface_element(lxb_dom_node_t * node)
307319 lxb_char_t * lxb_dom_element_qualified_name(lxb_dom_element_t * element, size_t * len )
308320 lxb_dom_node_t * lxb_dom_node_destroy(lxb_dom_node_t * node)
309321 lxb_dom_node_t * lxb_dom_node_destroy_deep(lxb_dom_node_t * root)
0 commit comments