Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/52ef77ceef3f2b2e1ba094aa8cd5c6b4494a91a0
...commit
http://git.netsurf-browser.org/netsurf.git/commit/52ef77ceef3f2b2e1ba094aa8cd5c6b4494a91a0
...tree
http://git.netsurf-browser.org/netsurf.git/tree/52ef77ceef3f2b2e1ba094aa8cd5c6b4494a91a0
The branch, master has been updated
via 52ef77ceef3f2b2e1ba094aa8cd5c6b4494a91a0 (commit)
via 654e1ee12ac3d405b4a98735179d749dc0047d05 (commit)
via 378383ea3bf04ab6e083c597298db63ff665837e (commit)
from d719bdcee3bf4cae2649535251d69a33839ae13a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=52ef77ceef3f2b2e1ba094aa8cd5c6b4494a91a0
commit 52ef77ceef3f2b2e1ba094aa8cd5c6b4494a91a0
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
Do not prevent reattempting conversion of HTML contents
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index a7fea6d..6fe45ad 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -1275,10 +1275,6 @@ bool html_can_begin_conversion(html_content *htmlc)
{
unsigned int i;
- /* Cannot begin conversion if we already have */
- if (htmlc->conversion_begun)
- return false;
-
/* Cannot begin conversion if we're still fetching stuff */
if (htmlc->base.active != 0)
return false;
@@ -1303,10 +1299,6 @@ html_begin_conversion(html_content *htmlc)
dom_string *node_name = NULL;
dom_hubbub_error error;
- if (htmlc->conversion_begun)
- /* Conversion already began, so we are okay */
- return true;
-
/* The act of completing the parse can result in additional data
* being flushed through the parser. This may result in new style or
* script nodes, upon which the conversion depends. Thus, once we
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=654e1ee12ac3d405b4a98735179d749dc0047d05
commit 654e1ee12ac3d405b4a98735179d749dc0047d05
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
Use new safe context dump
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/content/handlers/javascript/duktape/Window.bnd
b/content/handlers/javascript/duktape/Window.bnd
index 5283a14..f71ebd6 100644
--- a/content/handlers/javascript/duktape/Window.bnd
+++ b/content/handlers/javascript/duktape/Window.bnd
@@ -62,9 +62,7 @@ static void window_call_callback(duk_context *ctx, size_t
handle, bool clear_ent
/* ..., win, cbt, handle */
duk_get_prop(ctx, -2);
/* ..., win, cbt, cbo */
- duk_push_context_dump(ctx);
- NSLOG(dukky, DEEPDEBUG, "On entry to callback, stack is: %s",
duk_get_string(ctx, -1));
- duk_pop(ctx);
+ dukky_log_stack_frame(ctx, "On entry to callback");
/* ..., win, cbt, cbo */
/* What we want to do is call cbo.func passing all of cbo.args */
duk_get_prop_string(ctx, -1, "func");
@@ -78,9 +76,7 @@ static void window_call_callback(duk_context *ctx, size_t
handle, bool clear_ent
/* ..., win, cbt, cbo, func, argarr, args... */
duk_remove(ctx, -(arrlen+1));
/* ..., win, cbt, cbo, func, args... */
- duk_push_context_dump(ctx);
- NSLOG(dukky, DEEPDEBUG, "Just before call with %d args: %s",
(int)arrlen, duk_get_string(ctx, -1));
- duk_pop(ctx);
+ dukky_log_stack_frame(ctx, "Just before call");
(void) dukky_pcall(ctx, arrlen, true);
/* ..., win, cbt, cbo, retval */
if (clear_entry) {
@@ -96,9 +92,7 @@ static void window_call_callback(duk_context *ctx, size_t
handle, bool clear_ent
duk_pop_n(ctx, 4);
}
/* ... */
- duk_push_context_dump(ctx);
- NSLOG(dukky, DEEPDEBUG, "On leaving callback, stack is: %s",
duk_get_string(ctx, -1));
- duk_pop(ctx);
+ dukky_log_stack_frame(ctx, "On leaving callback");
}
static void window_schedule_callback(void *p) {
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=378383ea3bf04ab6e083c597298db63ff665837e
commit 378383ea3bf04ab6e083c597298db63ff665837e
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
Support context dump safely in duktape
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/content/handlers/javascript/duktape/dukky.c
b/content/handlers/javascript/duktape/dukky.c
index e9e579d..c3b9569 100644
--- a/content/handlers/javascript/duktape/dukky.c
+++ b/content/handlers/javascript/duktape/dukky.c
@@ -669,6 +669,8 @@ jsobject *js_newcompartment(jscontext *ctx, void *win_priv,
void *doc_priv)
duk_pop(CTX);
/* ... */
+ dukky_log_stack_frame(CTX, "New compartment created");
+
return (jsobject *)ctx;
}
@@ -698,8 +700,8 @@ static void dukky_dump_error(duk_context *ctx)
{
/* stack is ..., errobj */
duk_idx_t stacktop = duk_get_top(ctx);
- if (!duk_is_error(ctx, stacktop - 1)) {
- NSLOG(dukky, INFO, "Uncaught non-Error derived error in JS:
%s", duk_safe_to_string(ctx, stacktop - 1));
+ if (!duk_is_error(ctx, -1)) {
+ NSLOG(dukky, INFO, "Uncaught non-Error derived error in JS:
%s", duk_safe_to_string(ctx, -1));
} else {
#define GETTER(what) \
if (duk_has_prop_string(ctx, stacktop - 1, what)) { \
@@ -761,6 +763,23 @@ void dukky_push_generics(duk_context *ctx, const char
*generic)
/* ..., generic */
}
+static duk_int_t dukky_push_context_dump(duk_context *ctx, void *udata)
+{
+ duk_push_context_dump(ctx);
+ return 1;
+}
+
+void dukky_log_stack_frame(duk_context *ctx, const char * reason)
+{
+ if (duk_safe_call(ctx, dukky_push_context_dump, NULL, 0, 1) != 0) {
+ duk_pop(ctx);
+ duk_push_string(ctx, "[???]");
+ }
+ NSLOG(dukky, DEEPDEBUG, "%s, stack is: %s", reason,
duk_safe_to_string(ctx, -1));
+ duk_pop(ctx);
+}
+
+
/* exported interface documented in js.h */
bool
js_exec(jscontext *ctx, const uint8_t *txt, size_t txtlen, const char *name)
diff --git a/content/handlers/javascript/duktape/dukky.h
b/content/handlers/javascript/duktape/dukky.h
index 93d4169..5a67951 100644
--- a/content/handlers/javascript/duktape/dukky.h
+++ b/content/handlers/javascript/duktape/dukky.h
@@ -54,4 +54,7 @@ duk_int_t dukky_pcall(duk_context *ctx, duk_size_t argc, bool
reset_timeout);
/* Push a generics function onto the stack */
void dukky_push_generics(duk_context *ctx, const char *generic);
+/* Log the current stack frame if possible */
+void dukky_log_stack_frame(duk_context *ctx, const char * reason);
+
#endif
-----------------------------------------------------------------------
Summary of changes:
content/handlers/html/html.c | 8 --------
content/handlers/javascript/duktape/Window.bnd | 12 +++---------
content/handlers/javascript/duktape/dukky.c | 23 +++++++++++++++++++++--
content/handlers/javascript/duktape/dukky.h | 3 +++
4 files changed, 27 insertions(+), 19 deletions(-)
diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index a7fea6d..6fe45ad 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -1275,10 +1275,6 @@ bool html_can_begin_conversion(html_content *htmlc)
{
unsigned int i;
- /* Cannot begin conversion if we already have */
- if (htmlc->conversion_begun)
- return false;
-
/* Cannot begin conversion if we're still fetching stuff */
if (htmlc->base.active != 0)
return false;
@@ -1303,10 +1299,6 @@ html_begin_conversion(html_content *htmlc)
dom_string *node_name = NULL;
dom_hubbub_error error;
- if (htmlc->conversion_begun)
- /* Conversion already began, so we are okay */
- return true;
-
/* The act of completing the parse can result in additional data
* being flushed through the parser. This may result in new style or
* script nodes, upon which the conversion depends. Thus, once we
diff --git a/content/handlers/javascript/duktape/Window.bnd
b/content/handlers/javascript/duktape/Window.bnd
index 5283a14..f71ebd6 100644
--- a/content/handlers/javascript/duktape/Window.bnd
+++ b/content/handlers/javascript/duktape/Window.bnd
@@ -62,9 +62,7 @@ static void window_call_callback(duk_context *ctx, size_t
handle, bool clear_ent
/* ..., win, cbt, handle */
duk_get_prop(ctx, -2);
/* ..., win, cbt, cbo */
- duk_push_context_dump(ctx);
- NSLOG(dukky, DEEPDEBUG, "On entry to callback, stack is: %s",
duk_get_string(ctx, -1));
- duk_pop(ctx);
+ dukky_log_stack_frame(ctx, "On entry to callback");
/* ..., win, cbt, cbo */
/* What we want to do is call cbo.func passing all of cbo.args */
duk_get_prop_string(ctx, -1, "func");
@@ -78,9 +76,7 @@ static void window_call_callback(duk_context *ctx, size_t
handle, bool clear_ent
/* ..., win, cbt, cbo, func, argarr, args... */
duk_remove(ctx, -(arrlen+1));
/* ..., win, cbt, cbo, func, args... */
- duk_push_context_dump(ctx);
- NSLOG(dukky, DEEPDEBUG, "Just before call with %d args: %s",
(int)arrlen, duk_get_string(ctx, -1));
- duk_pop(ctx);
+ dukky_log_stack_frame(ctx, "Just before call");
(void) dukky_pcall(ctx, arrlen, true);
/* ..., win, cbt, cbo, retval */
if (clear_entry) {
@@ -96,9 +92,7 @@ static void window_call_callback(duk_context *ctx, size_t
handle, bool clear_ent
duk_pop_n(ctx, 4);
}
/* ... */
- duk_push_context_dump(ctx);
- NSLOG(dukky, DEEPDEBUG, "On leaving callback, stack is: %s",
duk_get_string(ctx, -1));
- duk_pop(ctx);
+ dukky_log_stack_frame(ctx, "On leaving callback");
}
static void window_schedule_callback(void *p) {
diff --git a/content/handlers/javascript/duktape/dukky.c
b/content/handlers/javascript/duktape/dukky.c
index e9e579d..c3b9569 100644
--- a/content/handlers/javascript/duktape/dukky.c
+++ b/content/handlers/javascript/duktape/dukky.c
@@ -669,6 +669,8 @@ jsobject *js_newcompartment(jscontext *ctx, void *win_priv,
void *doc_priv)
duk_pop(CTX);
/* ... */
+ dukky_log_stack_frame(CTX, "New compartment created");
+
return (jsobject *)ctx;
}
@@ -698,8 +700,8 @@ static void dukky_dump_error(duk_context *ctx)
{
/* stack is ..., errobj */
duk_idx_t stacktop = duk_get_top(ctx);
- if (!duk_is_error(ctx, stacktop - 1)) {
- NSLOG(dukky, INFO, "Uncaught non-Error derived error in JS:
%s", duk_safe_to_string(ctx, stacktop - 1));
+ if (!duk_is_error(ctx, -1)) {
+ NSLOG(dukky, INFO, "Uncaught non-Error derived error in JS:
%s", duk_safe_to_string(ctx, -1));
} else {
#define GETTER(what) \
if (duk_has_prop_string(ctx, stacktop - 1, what)) { \
@@ -761,6 +763,23 @@ void dukky_push_generics(duk_context *ctx, const char
*generic)
/* ..., generic */
}
+static duk_int_t dukky_push_context_dump(duk_context *ctx, void *udata)
+{
+ duk_push_context_dump(ctx);
+ return 1;
+}
+
+void dukky_log_stack_frame(duk_context *ctx, const char * reason)
+{
+ if (duk_safe_call(ctx, dukky_push_context_dump, NULL, 0, 1) != 0) {
+ duk_pop(ctx);
+ duk_push_string(ctx, "[???]");
+ }
+ NSLOG(dukky, DEEPDEBUG, "%s, stack is: %s", reason,
duk_safe_to_string(ctx, -1));
+ duk_pop(ctx);
+}
+
+
/* exported interface documented in js.h */
bool
js_exec(jscontext *ctx, const uint8_t *txt, size_t txtlen, const char *name)
diff --git a/content/handlers/javascript/duktape/dukky.h
b/content/handlers/javascript/duktape/dukky.h
index 93d4169..5a67951 100644
--- a/content/handlers/javascript/duktape/dukky.h
+++ b/content/handlers/javascript/duktape/dukky.h
@@ -54,4 +54,7 @@ duk_int_t dukky_pcall(duk_context *ctx, duk_size_t argc, bool
reset_timeout);
/* Push a generics function onto the stack */
void dukky_push_generics(duk_context *ctx, const char *generic);
+/* Log the current stack frame if possible */
+void dukky_log_stack_frame(duk_context *ctx, const char * reason);
+
#endif
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org