From 946c2e11f64b064365860d1f62e499d08f36fd44 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Fri, 5 May 2023 13:55:40 +0200 Subject: [PATCH] [libdom] removed CONFIG_XML in a few places --- src/document/Makefile | 1 - src/document/meson.build | 3 -- src/ecmascript/Makefile | 6 +-- src/ecmascript/ecmascript.cpp | 46 +-------------------- src/ecmascript/libdom/spidermonkey/Makefile | 2 +- src/ecmascript/meson.build | 6 +-- src/ecmascript/quickjs.cpp | 2 - 7 files changed, 9 insertions(+), 57 deletions(-) diff --git a/src/document/Makefile b/src/document/Makefile index 6d272fdca..f10903dbd 100644 --- a/src/document/Makefile +++ b/src/document/Makefile @@ -5,7 +5,6 @@ SUBDIRS-$(CONFIG_CSS) += css SUBDIRS-$(CONFIG_DOM) += dom SUBDIRS-$(CONFIG_LIBCSS) += css2 SUBDIRS-$(CONFIG_LIBDOM) += libdom -SUBDIRS-$(CONFIG_XML) += xml SUBDIRS = gemini html plain diff --git a/src/document/meson.build b/src/document/meson.build index 3c69a0615..2cfa342ad 100644 --- a/src/document/meson.build +++ b/src/document/meson.build @@ -13,7 +13,4 @@ endif subdir('gemini') subdir('html') subdir('plain') -if conf_data.get('CONFIG_XML') - subdir('xml') -endif srcs += files('docdata.c', 'document.cpp', 'format.c', 'forms.c', 'options.c', 'refresh.c', 'renderer.cpp') diff --git a/src/ecmascript/Makefile b/src/ecmascript/Makefile index c76fdb8ce..2823e3325 100644 --- a/src/ecmascript/Makefile +++ b/src/ecmascript/Makefile @@ -4,11 +4,11 @@ INCLUDES += $(SPIDERMONKEY_CFLAGS) $(MUJS_CFLAGS) SUBDIRS-$(CONFIG_LIBDOM) += libdom -OBJS-$(CONFIG_ECMASCRIPT_SMJS) += css2xpath.obj ecmascript.obj localstorage-db.obj spidermonkey.obj timer.obj +OBJS-$(CONFIG_ECMASCRIPT_SMJS) += ecmascript.obj localstorage-db.obj spidermonkey.obj timer.obj -OBJS-$(CONFIG_MUJS) += css2xpath.obj ecmascript.obj localstorage-db.obj mujs.obj timer.obj +OBJS-$(CONFIG_MUJS) += ecmascript.obj localstorage-db.obj mujs.obj timer.obj -OBJS-$(CONFIG_QUICKJS) += css2xpath.obj ecmascript.obj localstorage-db.obj quickjs.obj timer.obj +OBJS-$(CONFIG_QUICKJS) += ecmascript.obj localstorage-db.obj quickjs.obj timer.obj ifeq ($(CONFIG_ECMASCRIPT_SMJS), yes) CONFIG_ANY_SPIDERMONKEY = yes diff --git a/src/ecmascript/ecmascript.cpp b/src/ecmascript/ecmascript.cpp index dcee7528a..38a63b845 100644 --- a/src/ecmascript/ecmascript.cpp +++ b/src/ecmascript/ecmascript.cpp @@ -50,10 +50,6 @@ #include -#include -#include -#include - #include #include @@ -816,48 +812,10 @@ free_document(void *doc) if (!doc) { return; } - xmlpp::Document *docu = static_cast(doc); - delete docu; +// xmlpp::Document *docu = static_cast(doc); +// delete docu; } -#ifndef CONFIG_LIBDOM -void *document_parse_text(char *text, size_t length) -{ - return NULL; -} - -void * -document_parse(struct document *document) -{ -#ifdef ECMASCRIPT_DEBUG - fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__); -#endif - struct cache_entry *cached = document->cached; - struct fragment *f = get_cache_fragment(cached); - const char *encoding; - - if (!f || !f->length) { - return NULL; - } - - struct string str; - if (!init_string(&str)) { - return NULL; - } - add_bytes_to_string(&str, f->data, f->length); - encoding = document->cp > 0 ? get_cp_mime_name(document->cp) : NULL; - - // Parse HTML and create a DOM tree - xmlDoc* doc = htmlReadDoc((xmlChar*)str.source, NULL, encoding, - HTML_PARSE_RECOVER | HTML_PARSE_NOERROR | HTML_PARSE_NOWARNING); - // Encapsulate raw libxml document in a libxml++ wrapper - xmlpp::Document *docu = new xmlpp::Document(doc); - done_string(&str); - - return (void *)docu; -} -#endif - static void delayed_goto(void *data) { diff --git a/src/ecmascript/libdom/spidermonkey/Makefile b/src/ecmascript/libdom/spidermonkey/Makefile index 59cb4e0b1..53e16f53b 100644 --- a/src/ecmascript/libdom/spidermonkey/Makefile +++ b/src/ecmascript/libdom/spidermonkey/Makefile @@ -1,4 +1,4 @@ -top_builddir=../../.. +top_builddir=../../../.. include $(top_builddir)/Makefile.config INCLUDES += $(SPIDERMONKEY_CFLAGS) diff --git a/src/ecmascript/meson.build b/src/ecmascript/meson.build index 177b43611..78d5bae21 100644 --- a/src/ecmascript/meson.build +++ b/src/ecmascript/meson.build @@ -1,6 +1,6 @@ #INCLUDES += $(SPIDERMONKEY_CFLAGS) if conf_data.get('CONFIG_ECMASCRIPT_SMJS') - srcs += files('css2xpath.cpp', 'ecmascript.cpp', 'localstorage-db.cpp', 'spidermonkey.cpp', 'timer.cpp') + srcs += files('ecmascript.cpp', 'localstorage-db.cpp', 'spidermonkey.cpp', 'timer.cpp') endif if conf_data.get('CONFIG_ECMASCRIPT_SMJS') @@ -16,11 +16,11 @@ if CONFIG_ANY_SPIDERMONKEY endif if conf_data.get('CONFIG_MUJS') - srcs += files('css2xpath.cpp', 'ecmascript.cpp', 'localstorage-db.cpp', 'mujs.cpp', 'timer.cpp') + srcs += files('ecmascript.cpp', 'localstorage-db.cpp', 'mujs.cpp', 'timer.cpp') endif if conf_data.get('CONFIG_QUICKJS') - srcs += files('css2xpath.cpp', 'ecmascript.cpp', 'localstorage-db.cpp', 'quickjs.cpp', 'timer.cpp') + srcs += files('ecmascript.cpp', 'localstorage-db.cpp', 'quickjs.cpp', 'timer.cpp') endif if conf_data.get('CONFIG_LIBDOM') diff --git a/src/ecmascript/quickjs.cpp b/src/ecmascript/quickjs.cpp index 5535fbb47..1187c513c 100644 --- a/src/ecmascript/quickjs.cpp +++ b/src/ecmascript/quickjs.cpp @@ -58,8 +58,6 @@ #include "viewer/text/view.h" #include "viewer/text/vs.h" -#include - /*** Global methods */ static void