mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
Add a data member to struct dom_stack_context (not used yet)
This commit is contained in:
parent
12a2f96920
commit
0faa8d7462
@ -803,7 +803,8 @@ render_dom_document(struct cache_entry *cached, struct document *document,
|
|||||||
&renderer, cached->uri);
|
&renderer, cached->uri);
|
||||||
if (!parser) return;
|
if (!parser) return;
|
||||||
|
|
||||||
add_dom_stack_context(&parser->stack, &dom_source_renderer_context_info);
|
add_dom_stack_context(&parser->stack, &renderer,
|
||||||
|
&dom_source_renderer_context_info);
|
||||||
|
|
||||||
root = parse_sgml(parser, buffer);
|
root = parse_sgml(parser, buffer);
|
||||||
done_sgml_parser(parser);
|
done_sgml_parser(parser);
|
||||||
|
@ -831,7 +831,8 @@ select_dom_nodes(struct dom_select *select, struct dom_node *root)
|
|||||||
select_data.select = select;;
|
select_data.select = select;;
|
||||||
|
|
||||||
init_dom_stack(&stack, &select_data, 0, 1);
|
init_dom_stack(&stack, &select_data, 0, 1);
|
||||||
add_dom_stack_context(&stack, &dom_select_context_info);
|
add_dom_stack_context(&stack, &select_data,
|
||||||
|
&dom_select_context_info);
|
||||||
|
|
||||||
init_dom_stack(&select_data.stack, &select_data, obj_size, 1);
|
init_dom_stack(&select_data.stack, &select_data, obj_size, 1);
|
||||||
|
|
||||||
|
@ -78,13 +78,17 @@ done_dom_stack(struct dom_stack *stack)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
add_dom_stack_context(struct dom_stack *stack,
|
add_dom_stack_context(struct dom_stack *stack, void *data,
|
||||||
struct dom_stack_context_info *context_info)
|
struct dom_stack_context_info *context_info)
|
||||||
{
|
{
|
||||||
|
struct dom_stack_context *context;
|
||||||
|
|
||||||
if (!realloc_dom_stack_context(&stack->contexts, stack->contexts_size))
|
if (!realloc_dom_stack_context(&stack->contexts, stack->contexts_size))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
stack->contexts[stack->contexts_size++].info = context_info;
|
context = &stack->contexts[stack->contexts_size++];
|
||||||
|
context->info = context_info;
|
||||||
|
context->data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum dom_stack_action {
|
enum dom_stack_action {
|
||||||
|
@ -16,6 +16,10 @@ struct dom_stack_context_info {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct dom_stack_context {
|
struct dom_stack_context {
|
||||||
|
/* Data specific to the parser and renderer. */
|
||||||
|
void *data;
|
||||||
|
|
||||||
|
/* Info about node callbacks and such. */
|
||||||
struct dom_stack_context_info *info;
|
struct dom_stack_context_info *info;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -124,7 +128,7 @@ void init_dom_stack(struct dom_stack *stack, void *data,
|
|||||||
void done_dom_stack(struct dom_stack *stack);
|
void done_dom_stack(struct dom_stack *stack);
|
||||||
|
|
||||||
/* Add a callback collection to the stack. */
|
/* Add a callback collection to the stack. */
|
||||||
void add_dom_stack_context(struct dom_stack *stack,
|
void add_dom_stack_context(struct dom_stack *stack, void *data,
|
||||||
struct dom_stack_context_info *context_info);
|
struct dom_stack_context_info *context_info);
|
||||||
|
|
||||||
/* Decends down to the given node making it the current parent */
|
/* Decends down to the given node making it the current parent */
|
||||||
|
Loading…
Reference in New Issue
Block a user