diff --git a/src/ecmascript/quickjs/document.c b/src/ecmascript/quickjs/document.c index d023bd35..d89a639f 100644 --- a/src/ecmascript/quickjs/document.c +++ b/src/ecmascript/quickjs/document.c @@ -1043,15 +1043,11 @@ js_document_replace(JSContext *ctx, JSValueConst this_val, int argc, JSValueCons struct string nu_str; if (init_string(&nu_str)) { - ssize_t fd_len = f->length; string_replace(&nu_str, &f_data, &needle, &heystack); delete_entry_content(cached); - /* This is very ugly, indeed. And Yes fd_len isn't - * logically correct. But using nu_str.length will cause - * the document to render improperly. - * TBD: somehow better rerender the document + /* TBD: somehow better rerender the document * now it's places on the session level in doc_loading_callback */ - add_fragment(cached, 0, nu_str.source, fd_len); + add_fragment(cached, 0, nu_str.source, nu_str.length); normalize_cache_entry(cached, nu_str.length); document->ecmascript_counter++; done_string(&nu_str); diff --git a/src/ecmascript/spidermonkey/document.c b/src/ecmascript/spidermonkey/document.c index 70159af4..f01e674a 100644 --- a/src/ecmascript/spidermonkey/document.c +++ b/src/ecmascript/spidermonkey/document.c @@ -1428,15 +1428,11 @@ document_replace(JSContext *ctx, unsigned int argc, JS::Value *vp) struct string nu_str; if (init_string(&nu_str)) { - ssize_t fd_len = f->length; string_replace(&nu_str, &f_data, &needle, &heystack); delete_entry_content(cached); - /* This is very ugly, indeed. And Yes fd_len isn't - * logically correct. But using nu_str.length will cause - * the document to render improperly. - * TBD: somehow better rerender the document - * now it's places on the session level in doc_loading_callback */ - add_fragment(cached, 0, nu_str.source, fd_len); + /* TBD: somehow better rerender the document + * now it's places on the session level in doc_loading_callback */ + add_fragment(cached, 0, nu_str.source, nu_str.length); normalize_cache_entry(cached, nu_str.length); document->ecmascript_counter++; done_string(&nu_str); diff --git a/src/session/session.c b/src/session/session.c index 2de99825..486e39ef 100644 --- a/src/session/session.c +++ b/src/session/session.c @@ -713,7 +713,7 @@ doc_rerender_after_document_update(struct session *ses) { } if (ses->doc_view->document->ecmascript_counter > 0) { if (ses->doc_view->vs) { - draw_formatted(ses, 1); + draw_formatted(ses, 3); //DBG("REDRAWING..."); } }