1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-26 01:15:37 +00:00

[quickjs] element.c

This commit is contained in:
Witold Filipczyk 2021-10-29 22:06:39 +02:00
parent 85ec5fa83a
commit e15d58dfd1
6 changed files with 1680 additions and 9 deletions

View File

@ -13,6 +13,10 @@
#include <jsapi.h>
#endif
#ifdef CONFIG_QUICKJS
#include <quickjs/quickjs.h>
#endif
#ifdef CONFIG_ECMASCRIPT
#include "main/module.h"
@ -71,8 +75,13 @@ struct ecmascript_interpreter {
unsigned int onload_snippets_cache_id;
void *ac;
void *ac2;
#ifdef CONFIG_QUICKJS
JSValue document_obj;
JSValue location_obj;
#else
void *document_obj;
void *location_obj;
#endif
#ifdef CONFIG_ECMASCRIPT_SMJS
JS::RootedValue fun;
#endif

View File

@ -18,5 +18,5 @@ endif
if conf_data.get('CONFIG_QUICKJS')
subdir('quickjs')
srcs += files('ecmascript.c', 'localstorage-db.c', 'quickjs.c', 'empty.cpp')
srcs += files('css2xpath.c', 'ecmascript.c', 'localstorage-db.c', 'quickjs.c', 'empty.cpp')
endif

View File

@ -21,6 +21,7 @@
#include "document/view.h"
#include "ecmascript/ecmascript.h"
#include "ecmascript/quickjs/collection.h"
#include "ecmascript/quickjs/element.h"
#include "intl/libintl.h"
#include "main/select.h"
#include "osdep/newwin.h"
@ -55,12 +56,6 @@
static JSClassID js_htmlCollection_class_id;
// Placeholder
JSValue getElement(JSContext *ctx, void *node)
{
return JS_NULL;
}
static JSValue
js_htmlCollection_get_property_length(JSContext *ctx, JSValueConst this_val)
{
@ -271,7 +266,6 @@ js_htmlCollection_init(JSContext *ctx, JSValue global_obj)
return 0;
}
JSValue
getCollection(JSContext *ctx, void *node)
{

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,10 @@
#ifndef EL__ECMASCRIPT_QUICKJS_ELEMENT_H
#define EL__ECMASCRIPT_QUICKJS_ELEMENT_H
#include <quickjs/quickjs.h>
JSValue getElement(JSContext *ctx, void *node);
void walk_tree(struct string *buf, void *nod, bool start = true, bool toSortAttrs = false);
#endif

View File

@ -1 +1 @@
srcs += files('attr.c', 'attributes.c', 'collection.c', 'console.c', 'history.c', 'localstorage.c', 'location.c', 'navigator.c', 'nodelist.c', 'screen.c', 'unibar.c', 'window.c')
srcs += files('attr.c', 'attributes.c', 'collection.c', 'console.c', 'element.c', 'history.c', 'localstorage.c', 'location.c', 'navigator.c', 'nodelist.c', 'screen.c', 'unibar.c', 'window.c')