From 156b031c1682e1b5e18d5486b46af36590849791 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Tue, 5 Aug 2025 17:28:18 +0200 Subject: [PATCH] doc: add is_html field --- src/core/document.c | 1 + src/core/document.h | 2 ++ src/html/html_document.c | 2 ++ 3 files changed, 5 insertions(+) diff --git a/src/core/document.c b/src/core/document.c index a7b6ccc..7c8500d 100644 --- a/src/core/document.c +++ b/src/core/document.c @@ -139,6 +139,7 @@ dom_exception _dom_document_initialise(dom_document *doc, return err; } + doc->is_html = false; doc->nodelists = NULL; doc->script_added_callback = NULL; doc->script_added_callback_ctx = NULL; diff --git a/src/core/document.h b/src/core/document.h index f09e3da..e480a01 100644 --- a/src/core/document.h +++ b/src/core/document.h @@ -68,6 +68,8 @@ struct dom_document { void* script_added_callback_ctx; dom_script_added_callback script_added_callback; + bool is_html; + /* Memoised event strings */ dom_string *_memo_domnodeinserted; /**< DOMNodeInserted */ dom_string *_memo_domnoderemoved; /**< DOMNodeRemoved */ diff --git a/src/html/html_document.c b/src/html/html_document.c index 1fd21f9..323bb95 100644 --- a/src/html/html_document.c +++ b/src/html/html_document.c @@ -127,6 +127,8 @@ dom_exception _dom_html_document_initialise(dom_html_document *doc, if (error != DOM_NO_ERR) return error; + doc->base.is_html = true; + doc->title = NULL; doc->referrer = NULL; doc->domain = NULL;