mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[document] Try to pass element_offset
This commit is contained in:
parent
d08bd08171
commit
583aec98f0
@ -373,12 +373,12 @@ check_for_rerender(struct ecmascript_interpreter *interpreter, const char* text)
|
|||||||
struct cache_entry *cached = document->cached;
|
struct cache_entry *cached = document->cached;
|
||||||
|
|
||||||
if (!strcmp(text, "eval")) {
|
if (!strcmp(text, "eval")) {
|
||||||
if (interpreter->element_offset) {
|
if (interpreter->write_element_offset) {
|
||||||
if (interpreter->writecode.length) {
|
if (interpreter->writecode.length) {
|
||||||
std::map<int, xmlpp::Element *> *mapa = (std::map<int, xmlpp::Element *> *)document->element_map;
|
std::map<int, xmlpp::Element *> *mapa = (std::map<int, xmlpp::Element *> *)document->element_map;
|
||||||
|
|
||||||
if (mapa) {
|
if (mapa) {
|
||||||
auto element = (*mapa).find(interpreter->element_offset);
|
auto element = (*mapa).find(interpreter->write_element_offset);
|
||||||
|
|
||||||
if (element != (*mapa).end()) {
|
if (element != (*mapa).end()) {
|
||||||
xmlpp::Element *el = element->second;
|
xmlpp::Element *el = element->second;
|
||||||
@ -408,6 +408,7 @@ check_for_rerender(struct ecmascript_interpreter *interpreter, const char* text)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
interpreter->write_element_offset = 0;
|
||||||
} else {
|
} else {
|
||||||
if (interpreter->writecode.length) {
|
if (interpreter->writecode.length) {
|
||||||
fromstart:
|
fromstart:
|
||||||
|
@ -110,6 +110,7 @@ struct ecmascript_interpreter {
|
|||||||
#endif
|
#endif
|
||||||
bool changed;
|
bool changed;
|
||||||
int element_offset;
|
int element_offset;
|
||||||
|
int write_element_offset;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ecmascript_timeout {
|
struct ecmascript_timeout {
|
||||||
|
@ -1307,6 +1307,7 @@ document_write_do(JSContext *ctx, unsigned int argc, JS::Value *rval, int newlin
|
|||||||
|
|
||||||
if (argc >= 1)
|
if (argc >= 1)
|
||||||
{
|
{
|
||||||
|
interpreter->write_element_offset = interpreter->element_offset;
|
||||||
for (unsigned int i = 0; i < argc; ++i)
|
for (unsigned int i = 0; i < argc; ++i)
|
||||||
{
|
{
|
||||||
char *str = jsval_to_string(ctx, args[i]);
|
char *str = jsval_to_string(ctx, args[i]);
|
||||||
|
Loading…
Reference in New Issue
Block a user