mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[xml] onload
This commit is contained in:
parent
e52c6fe4ea
commit
488ee2ea59
@ -154,6 +154,7 @@ struct html_element {
|
|||||||
int namelen;
|
int namelen;
|
||||||
|
|
||||||
char *options;
|
char *options;
|
||||||
|
void *node;
|
||||||
/* See document/html/parser/parse.c's element_info.linebreak
|
/* See document/html/parser/parse.c's element_info.linebreak
|
||||||
* description. */
|
* description. */
|
||||||
int linebreak;
|
int linebreak;
|
||||||
|
@ -27,6 +27,9 @@
|
|||||||
/* Unsafe macros */
|
/* Unsafe macros */
|
||||||
#include "document/html/internal.h"
|
#include "document/html/internal.h"
|
||||||
|
|
||||||
|
#ifdef CONFIG_XML
|
||||||
|
#include <libxml++/libxml++.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
void
|
void
|
||||||
@ -86,11 +89,22 @@ kill_html_stack_item(struct html_context *html_context, struct html_element *e)
|
|||||||
if_assert_failed return;
|
if_assert_failed return;
|
||||||
|
|
||||||
#ifdef CONFIG_ECMASCRIPT
|
#ifdef CONFIG_ECMASCRIPT
|
||||||
|
|
||||||
|
#ifdef CONFIG_XML
|
||||||
|
xmlpp::Element *elem = e->node;
|
||||||
|
if (elem) {
|
||||||
|
std::string onload_value = elem->get_attribute_value("onload");
|
||||||
|
if (onload_value != "") {
|
||||||
|
onload = memacpy(onload_value.c_str(), onload_value.size());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
/* As our another tiny l33t extension, we allow the onLoad attribute for
|
/* As our another tiny l33t extension, we allow the onLoad attribute for
|
||||||
* any element, executing it when that element is fully loaded. */
|
* any element, executing it when that element is fully loaded. */
|
||||||
if (e->options)
|
if (e->options)
|
||||||
onload = get_attr_val(e->options, "onLoad",
|
onload = get_attr_val(e->options, "onLoad",
|
||||||
html_context->doc_cp);
|
html_context->doc_cp);
|
||||||
|
#endif
|
||||||
if (html_context->part
|
if (html_context->part
|
||||||
&& html_context->part->document
|
&& html_context->part->document
|
||||||
&& onload && *onload && *onload != '^') {
|
&& onload && *onload && *onload != '^') {
|
||||||
|
@ -4630,6 +4630,7 @@ start_element_2(struct element_info2 *ei, struct source_renderer *renderer, void
|
|||||||
html_top->name = ei->name;
|
html_top->name = ei->name;
|
||||||
html_top->namelen = ei->namelen;
|
html_top->namelen = ei->namelen;
|
||||||
html_top->options = NULL;//attr;
|
html_top->options = NULL;//attr;
|
||||||
|
html_top->node = node;
|
||||||
html_top->linebreak = ei->linebreak;
|
html_top->linebreak = ei->linebreak;
|
||||||
|
|
||||||
/* If the element has an onClick handler for scripts, make it
|
/* If the element has an onClick handler for scripts, make it
|
||||||
|
Loading…
Reference in New Issue
Block a user