summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2003-07-22 22:13:44 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2003-07-22 22:13:44 +0000
commit3c0daf429a15b39a8e5d521449be4306b14f579a (patch)
tree4abc571db073a984957623de76110ca0a472dbd1 /render
parente13bb8daa87c01c0f5a478a96b7fa822955770cd (diff)
downloadnetsurf-3c0daf429a15b39a8e5d521449be4306b14f579a.tar.gz
netsurf-3c0daf429a15b39a8e5d521449be4306b14f579a.tar.bz2
[project @ 2003-07-22 22:13:44 by jmb]
Enable viewing HTML source when F8 is pressed svn path=/import/netsurf/; revision=241
Diffstat (limited to 'render')
-rw-r--r--render/html.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/render/html.c b/render/html.c
index be0044fce..a6e6d9e7d 100644
--- a/render/html.c
+++ b/render/html.c
@@ -35,6 +35,8 @@ void html_create(struct content *c)
c->data.html.layout = NULL;
c->data.html.style = NULL;
c->data.html.fonts = NULL;
+ c->data.html.length = 0;
+ c->data.html.source = xcalloc(0, 1);
}
@@ -45,6 +47,10 @@ void html_process_data(struct content *c, char *data, unsigned long size)
unsigned long x;
LOG(("content %s, size %lu", c->url, size));
cache_dump();
+ c->data.html.source = xrealloc(c->data.html.source, c->data.html.length + size);
+ memcpy(c->data.html.source + c->data.html.length, data, size);
+ c->data.html.length += size;
+ c->size += size;
for (x = 0; x + CHUNK <= size; x += CHUNK) {
htmlParseChunk(c->data.html.parser, data + x, CHUNK, 0);
gui_multitask();
@@ -571,5 +577,7 @@ void html_destroy(struct content *c)
LOG(("title %p", c->title));
if (c->title != 0)
xfree(c->title);
+ if (c->data.html.source != 0)
+ xfree(c->data.html.source);
}