summaryrefslogtreecommitdiff
path: root/content/handlers/html
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2019-08-06 09:41:22 +0100
committerMichael Drake <michael.drake@codethink.co.uk>2019-08-06 09:42:37 +0100
commit5e45c4498c0a8a24330864b3d4c68ffe891ce15e (patch)
treefe20319f2efc9dca39fe45ed6228dfd529ae3be5 /content/handlers/html
parentc238325b12318803a8dcc706d7d678333f82e1c8 (diff)
downloadnetsurf-5e45c4498c0a8a24330864b3d4c68ffe891ce15e.tar.gz
netsurf-5e45c4498c0a8a24330864b3d4c68ffe891ce15e.tar.bz2
HTML: Don't allow objects to redraw until we have a layout.
Diffstat (limited to 'content/handlers/html')
-rw-r--r--content/handlers/html/html.c1
-rw-r--r--content/handlers/html/html_internal.h3
-rw-r--r--content/handlers/html/html_object.c8
3 files changed, 12 insertions, 0 deletions
diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index bcbd4382a..ed48af20e 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -1592,6 +1592,7 @@ static void html_reformat(struct content *c, int width, int height)
selection_reinit(&htmlc->sel, htmlc->layout);
htmlc->reflowing = false;
+ htmlc->had_initial_layout = true;
/* calculate next reflow time at three times what it took to reflow */
nsu_getmonotonic_ms(&ms_after);
diff --git a/content/handlers/html/html_internal.h b/content/handlers/html/html_internal.h
index 2ba96f0f8..7a8d95612 100644
--- a/content/handlers/html/html_internal.h
+++ b/content/handlers/html/html_internal.h
@@ -127,6 +127,9 @@ typedef struct html_content {
/** Whether a layout (reflow) is in progress */
bool reflowing;
+ /** Whether an initial layout has been done */
+ bool had_initial_layout;
+
/** Whether scripts are enabled for this content */
bool enable_scripting;
diff --git a/content/handlers/html/html_object.c b/content/handlers/html/html_object.c
index acd32565b..37bf29faf 100644
--- a/content/handlers/html/html_object.c
+++ b/content/handlers/html/html_object.c
@@ -178,6 +178,10 @@ html_object_callback(hlcache_handle *object,
box->flags & REPLACE_DIM) {
union content_msg_data data;
+ if (c->had_initial_layout == false) {
+ break;
+ }
+
if (!box_visible(box))
break;
@@ -212,6 +216,10 @@ html_object_callback(hlcache_handle *object,
if (c->base.status != CONTENT_STATUS_LOADING) {
union content_msg_data data = event->data;
+ if (c->had_initial_layout == false) {
+ break;
+ }
+
if (!box_visible(box))
break;