summaryrefslogtreecommitdiff
path: root/render/html.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2004-07-16 20:26:49 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2004-07-16 20:26:49 +0000
commit51af46fde6b5885d32eab0812189eb8f5e270abf (patch)
tree68d72bf6dfb05988088c3bda1664db5ac1bb4c3b /render/html.c
parent6560a2ae5f68831bec809e9ee847ac0e36ff011d (diff)
downloadnetsurf-51af46fde6b5885d32eab0812189eb8f5e270abf.tar.gz
netsurf-51af46fde6b5885d32eab0812189eb8f5e270abf.tar.bz2
[project @ 2004-07-16 20:26:49 by jmb]
Preliminary overflow support. This also goes some way to making the horizontal scrollbar work. svn path=/import/netsurf/; revision=1088
Diffstat (limited to 'render/html.c')
-rw-r--r--render/html.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/render/html.c b/render/html.c
index 422528ad0..5fce63c26 100644
--- a/render/html.c
+++ b/render/html.c
@@ -181,6 +181,7 @@ bool html_convert(struct content *c, int width, int height)
xmlDoc *document;
xmlNode *html, *head;
union content_msg_data msg_data;
+ int descendant_width;
/* finish parsing */
htmlParseChunk(c->data.html.parser, "", 0, 1);
@@ -251,7 +252,16 @@ bool html_convert(struct content *c, int width, int height)
c->data.html.box_pool);
/*box_dump(c->data.html.layout->children, 0);*/
- c->width = c->data.html.layout->children->width;
+ descendant_width = c->data.html.layout->children->descendant_x1 -
+ c->data.html.layout->children->descendant_x0;
+
+ LOG(("Available width: %d, Returned Width: %d, Required width: %d", width, c->data.html.layout->children->width, descendant_width));
+
+ if (descendant_width > c->data.html.layout->children->width)
+ c->width = descendant_width;
+ else
+ c->width = c->data.html.layout->children->width;
+
c->height = c->data.html.layout->children->height;
if (c->active == 0) {
@@ -828,9 +838,21 @@ void html_stop(struct content *c)
void html_reformat(struct content *c, int width, int height)
{
+ int descendant_width;
+
layout_document(c->data.html.layout->children, width,
c->data.html.box_pool);
- c->width = c->data.html.layout->children->width;
+
+ descendant_width = c->data.html.layout->children->descendant_x1 -
+ c->data.html.layout->children->descendant_x0;
+
+ LOG(("Available width: %d, Returned Width: %d, Required width: %d", width, c->data.html.layout->children->width, descendant_width));
+
+ if (descendant_width > c->data.html.layout->children->width)
+ c->width = descendant_width;
+ else
+ c->width = c->data.html.layout->children->width;
+
c->height = c->data.html.layout->children->height;
}