Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/804faacf826856e1d939c20ce30be7b766c492db
...commit
http://git.netsurf-browser.org/netsurf.git/commit/804faacf826856e1d939c20ce30be7b766c492db
...tree
http://git.netsurf-browser.org/netsurf.git/tree/804faacf826856e1d939c20ce30be7b766c492db
The branch, master has been updated
via 804faacf826856e1d939c20ce30be7b766c492db (commit)
via aec946b4ffd19a959002af4b779d24894f7b1f57 (commit)
from a55a899e7450371556bd107178ea47d2deb1fe9f (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=804faacf826856e1d939c20ce30be7b766c492db
commit 804faacf826856e1d939c20ce30be7b766c492db
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
html: Handle canvas width/height stated explicitly in px
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/content/handlers/html/dom_event.c
b/content/handlers/html/dom_event.c
index b874d71..533c9d5 100644
--- a/content/handlers/html/dom_event.c
+++ b/content/handlers/html/dom_event.c
@@ -200,7 +200,7 @@ static nserror html_process_inserted_canvas(html_content
*htmlc, dom_node *node)
char * ended;
unsigned long width_n = strtoul(ptr, &ended, 10);
- if (ended == endptr) {
+ if (ended == endptr || strcasecmp(ended, "px") == 0) {
/* parsed it all */
width = width_n;
}
@@ -217,7 +217,7 @@ static nserror html_process_inserted_canvas(html_content
*htmlc, dom_node *node)
char * ended;
unsigned long height_n = strtoul(ptr, &ended, 10);
- if (ended == endptr) {
+ if (ended == endptr || strcasecmp(ended, "px") == 0) {
/* parsed it all */
height = height_n;
}
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=aec946b4ffd19a959002af4b779d24894f7b1f57
commit aec946b4ffd19a959002af4b779d24894f7b1f57
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
CanvasRenderingContext2D: More verbose input validation error message
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/content/handlers/javascript/duktape/CanvasRenderingContext2D.bnd
b/content/handlers/javascript/duktape/CanvasRenderingContext2D.bnd
index 5acf750..6b6039a 100644
--- a/content/handlers/javascript/duktape/CanvasRenderingContext2D.bnd
+++ b/content/handlers/javascript/duktape/CanvasRenderingContext2D.bnd
@@ -212,7 +212,8 @@ method CanvasRenderingContext2D::putImageData()
clipx < 0 || clipy < 0 || /* Input in range */
(clipx + clipw) > idpriv->width || /* Input in range */
(clipy + cliph) > idpriv->height) { /* Input in range */
- return duk_error(ctx, DUK_ERR_RANGE_ERROR, "invalid inputs");
+ return duk_error(ctx, DUK_ERR_RANGE_ERROR, "invalid inputs:
(%d,%d) (%d,%d) (%d,%d) (Me: %d,%d) (Img: %d,%d)",
+ x,y,clipx,clipy,clipw,cliph, priv->width,
priv->height, idpriv->width, idpriv->height);
}
bitmap_base = guit->bitmap->get_buffer(priv->bitmap);
-----------------------------------------------------------------------
Summary of changes:
content/handlers/html/dom_event.c | 4 ++--
content/handlers/javascript/duktape/CanvasRenderingContext2D.bnd | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/content/handlers/html/dom_event.c
b/content/handlers/html/dom_event.c
index b874d71..533c9d5 100644
--- a/content/handlers/html/dom_event.c
+++ b/content/handlers/html/dom_event.c
@@ -200,7 +200,7 @@ static nserror html_process_inserted_canvas(html_content
*htmlc, dom_node *node)
char * ended;
unsigned long width_n = strtoul(ptr, &ended, 10);
- if (ended == endptr) {
+ if (ended == endptr || strcasecmp(ended, "px") == 0) {
/* parsed it all */
width = width_n;
}
@@ -217,7 +217,7 @@ static nserror html_process_inserted_canvas(html_content
*htmlc, dom_node *node)
char * ended;
unsigned long height_n = strtoul(ptr, &ended, 10);
- if (ended == endptr) {
+ if (ended == endptr || strcasecmp(ended, "px") == 0) {
/* parsed it all */
height = height_n;
}
diff --git a/content/handlers/javascript/duktape/CanvasRenderingContext2D.bnd
b/content/handlers/javascript/duktape/CanvasRenderingContext2D.bnd
index 5acf750..6b6039a 100644
--- a/content/handlers/javascript/duktape/CanvasRenderingContext2D.bnd
+++ b/content/handlers/javascript/duktape/CanvasRenderingContext2D.bnd
@@ -212,7 +212,8 @@ method CanvasRenderingContext2D::putImageData()
clipx < 0 || clipy < 0 || /* Input in range */
(clipx + clipw) > idpriv->width || /* Input in range */
(clipy + cliph) > idpriv->height) { /* Input in range */
- return duk_error(ctx, DUK_ERR_RANGE_ERROR, "invalid inputs");
+ return duk_error(ctx, DUK_ERR_RANGE_ERROR, "invalid inputs:
(%d,%d) (%d,%d) (%d,%d) (Me: %d,%d) (Img: %d,%d)",
+ x,y,clipx,clipy,clipw,cliph, priv->width,
priv->height, idpriv->width, idpriv->height);
}
bitmap_base = guit->bitmap->get_buffer(priv->bitmap);
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]