Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/0db71994ea8ffd8a95b38b4ca415bc76d75a3acf
...commit
http://git.netsurf-browser.org/netsurf.git/commit/0db71994ea8ffd8a95b38b4ca415bc76d75a3acf
...tree
http://git.netsurf-browser.org/netsurf.git/tree/0db71994ea8ffd8a95b38b4ca415bc76d75a3acf
The branch, master has been updated
via 0db71994ea8ffd8a95b38b4ca415bc76d75a3acf (commit)
via 0f3b27916733bb8d962a8fd9434422421d489e23 (commit)
via b38f7cc7187a257f5fb04864ad2f44c4466c1ddc (commit)
via 6ad7b3e6080d7faf534e4a1865d77741b870b727 (commit)
from d77ed689e69c6db402cf8311b402f073172c35b1 (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=0db71994ea8ffd8a95b38b4ca415bc76d75a3acf
commit 0db71994ea8ffd8a95b38b4ca415bc76d75a3acf
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
HTML: Before building the box tree, get viewport dimensions.
diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index 6fe45ad..4443d2e 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -570,6 +570,25 @@ static bool html_process_img(html_content *c, dom_node
*node)
return success;
}
+static void html_get_dimensions(html_content *htmlc)
+{
+ unsigned w;
+ unsigned h;
+ union content_msg_data msg_data = {
+ .getdims = {
+ .viewport_width = &w,
+ .viewport_height = &h,
+ },
+ };
+
+ content_broadcast(&htmlc->base, CONTENT_MSG_GETDIMS, &msg_data);
+
+ htmlc->media.width.value = INTTOFIX(w);
+ htmlc->media.width.unit = CSS_UNIT_PX;
+ htmlc->media.height.value = INTTOFIX(h);
+ htmlc->media.height.unit = CSS_UNIT_PX;
+}
+
/* exported function documented in html/html_internal.h */
void html_finish_conversion(html_content *htmlc)
{
@@ -632,6 +651,8 @@ void html_finish_conversion(html_content *htmlc)
return;
}
+ html_get_dimensions(htmlc);
+
error = dom_to_box(html, htmlc, html_box_convert_done);
if (error != NSERROR_OK) {
NSLOG(netsurf, INFO, "box conversion failed");
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=0f3b27916733bb8d962a8fd9434422421d489e23
commit 0f3b27916733bb8d962a8fd9434422421d489e23
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
HTML content handler: Handle content msg for getdims.
diff --git a/content/handlers/html/html_object.c
b/content/handlers/html/html_object.c
index b56f8e4..1dc8e64 100644
--- a/content/handlers/html/html_object.c
+++ b/content/handlers/html/html_object.c
@@ -354,6 +354,13 @@ html_object_callback(hlcache_handle *object,
*(event->data.jscontext) = NULL;
break;
+ case CONTENT_MSG_GETDIMS:
+ *(event->data.getdims.viewport_width) =
+ content__get_width(&c->base);
+ *(event->data.getdims.viewport_height) =
+ content__get_height(&c->base);
+ break;
+
case CONTENT_MSG_SCROLL:
if (box->scroll_x != NULL)
scrollbar_set(box->scroll_x, event->data.scroll.x0,
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=b38f7cc7187a257f5fb04864ad2f44c4466c1ddc
commit b38f7cc7187a257f5fb04864ad2f44c4466c1ddc
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Browser window: Handle the content msg for getdims.
diff --git a/desktop/browser.c b/desktop/browser.c
index 9795f96..f18768b 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -1638,6 +1638,18 @@ browser_window_callback(hlcache_handle *c,
}
break;
+ case CONTENT_MSG_GETDIMS:
+ {
+ int width;
+ int height;
+
+ browser_window_get_dimensions(bw, &width, &height, true);
+
+ *(event->data.getdims.viewport_width) = width;
+ *(event->data.getdims.viewport_height) = height;
+ break;
+ }
+
case CONTENT_MSG_SCROLL:
{
struct rect rect = {
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=6ad7b3e6080d7faf534e4a1865d77741b870b727
commit 6ad7b3e6080d7faf534e4a1865d77741b870b727
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Content: Add content message to get viewport dimensions.
diff --git a/content/content.h b/content/content.h
index 417fb7b..2cbc9e3 100644
--- a/content/content.h
+++ b/content/content.h
@@ -71,6 +71,7 @@ typedef enum {
CONTENT_MSG_DOWNLOAD, /**< download, not for display */
CONTENT_MSG_LINK, /**< RFC5988 link */
CONTENT_MSG_GETCTX, /**< Javascript context */
+ CONTENT_MSG_GETDIMS, /**< Get viewport dimensions. */
CONTENT_MSG_SCROLL, /**< Request to scroll content */
CONTENT_MSG_DRAGSAVE, /**< Allow drag saving of content */
CONTENT_MSG_SAVELINK, /**< Allow URL to be saved */
@@ -140,6 +141,12 @@ union content_msg_data {
struct content_rfc5988_link *rfc5988_link;
/** CONTENT_MSG_GETCTX - Javascript context */
struct jscontext **jscontext;
+ /** CONTENT_MSG_GETDIMS - Get the viewport dimensions */
+ struct {
+ /* TODO: Consider getting screen_width, screen_height too. */
+ unsigned *viewport_width;
+ unsigned *viewport_height;
+ } getdims;
/** CONTENT_MSG_SCROLL - Part of content to scroll to show */
struct {
/** if true, scroll to show area given by (x0, y0) and (x1,y1).
-----------------------------------------------------------------------
Summary of changes:
content/content.h | 7 +++++++
content/handlers/html/html.c | 21 +++++++++++++++++++++
content/handlers/html/html_object.c | 7 +++++++
desktop/browser.c | 12 ++++++++++++
4 files changed, 47 insertions(+)
diff --git a/content/content.h b/content/content.h
index 417fb7b..2cbc9e3 100644
--- a/content/content.h
+++ b/content/content.h
@@ -71,6 +71,7 @@ typedef enum {
CONTENT_MSG_DOWNLOAD, /**< download, not for display */
CONTENT_MSG_LINK, /**< RFC5988 link */
CONTENT_MSG_GETCTX, /**< Javascript context */
+ CONTENT_MSG_GETDIMS, /**< Get viewport dimensions. */
CONTENT_MSG_SCROLL, /**< Request to scroll content */
CONTENT_MSG_DRAGSAVE, /**< Allow drag saving of content */
CONTENT_MSG_SAVELINK, /**< Allow URL to be saved */
@@ -140,6 +141,12 @@ union content_msg_data {
struct content_rfc5988_link *rfc5988_link;
/** CONTENT_MSG_GETCTX - Javascript context */
struct jscontext **jscontext;
+ /** CONTENT_MSG_GETDIMS - Get the viewport dimensions */
+ struct {
+ /* TODO: Consider getting screen_width, screen_height too. */
+ unsigned *viewport_width;
+ unsigned *viewport_height;
+ } getdims;
/** CONTENT_MSG_SCROLL - Part of content to scroll to show */
struct {
/** if true, scroll to show area given by (x0, y0) and (x1,y1).
diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index 6fe45ad..4443d2e 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -570,6 +570,25 @@ static bool html_process_img(html_content *c, dom_node
*node)
return success;
}
+static void html_get_dimensions(html_content *htmlc)
+{
+ unsigned w;
+ unsigned h;
+ union content_msg_data msg_data = {
+ .getdims = {
+ .viewport_width = &w,
+ .viewport_height = &h,
+ },
+ };
+
+ content_broadcast(&htmlc->base, CONTENT_MSG_GETDIMS, &msg_data);
+
+ htmlc->media.width.value = INTTOFIX(w);
+ htmlc->media.width.unit = CSS_UNIT_PX;
+ htmlc->media.height.value = INTTOFIX(h);
+ htmlc->media.height.unit = CSS_UNIT_PX;
+}
+
/* exported function documented in html/html_internal.h */
void html_finish_conversion(html_content *htmlc)
{
@@ -632,6 +651,8 @@ void html_finish_conversion(html_content *htmlc)
return;
}
+ html_get_dimensions(htmlc);
+
error = dom_to_box(html, htmlc, html_box_convert_done);
if (error != NSERROR_OK) {
NSLOG(netsurf, INFO, "box conversion failed");
diff --git a/content/handlers/html/html_object.c
b/content/handlers/html/html_object.c
index b56f8e4..1dc8e64 100644
--- a/content/handlers/html/html_object.c
+++ b/content/handlers/html/html_object.c
@@ -354,6 +354,13 @@ html_object_callback(hlcache_handle *object,
*(event->data.jscontext) = NULL;
break;
+ case CONTENT_MSG_GETDIMS:
+ *(event->data.getdims.viewport_width) =
+ content__get_width(&c->base);
+ *(event->data.getdims.viewport_height) =
+ content__get_height(&c->base);
+ break;
+
case CONTENT_MSG_SCROLL:
if (box->scroll_x != NULL)
scrollbar_set(box->scroll_x, event->data.scroll.x0,
diff --git a/desktop/browser.c b/desktop/browser.c
index 9795f96..f18768b 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -1638,6 +1638,18 @@ browser_window_callback(hlcache_handle *c,
}
break;
+ case CONTENT_MSG_GETDIMS:
+ {
+ int width;
+ int height;
+
+ browser_window_get_dimensions(bw, &width, &height, true);
+
+ *(event->data.getdims.viewport_width) = width;
+ *(event->data.getdims.viewport_height) = height;
+ break;
+ }
+
case CONTENT_MSG_SCROLL:
{
struct rect rect = {
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org