HTML: Don't allow objects to redraw until we have a layout.

This commit is contained in:
Michael Drake 2019-08-06 09:41:22 +01:00
parent c238325b12
commit 5e45c4498c
3 changed files with 12 additions and 0 deletions

View File

@ -1592,6 +1592,7 @@ static void html_reformat(struct content *c, int width, int height)
selection_reinit(&htmlc->sel, htmlc->layout); selection_reinit(&htmlc->sel, htmlc->layout);
htmlc->reflowing = false; htmlc->reflowing = false;
htmlc->had_initial_layout = true;
/* calculate next reflow time at three times what it took to reflow */ /* calculate next reflow time at three times what it took to reflow */
nsu_getmonotonic_ms(&ms_after); nsu_getmonotonic_ms(&ms_after);

View File

@ -127,6 +127,9 @@ typedef struct html_content {
/** Whether a layout (reflow) is in progress */ /** Whether a layout (reflow) is in progress */
bool reflowing; bool reflowing;
/** Whether an initial layout has been done */
bool had_initial_layout;
/** Whether scripts are enabled for this content */ /** Whether scripts are enabled for this content */
bool enable_scripting; bool enable_scripting;

View File

@ -178,6 +178,10 @@ html_object_callback(hlcache_handle *object,
box->flags & REPLACE_DIM) { box->flags & REPLACE_DIM) {
union content_msg_data data; union content_msg_data data;
if (c->had_initial_layout == false) {
break;
}
if (!box_visible(box)) if (!box_visible(box))
break; break;
@ -212,6 +216,10 @@ html_object_callback(hlcache_handle *object,
if (c->base.status != CONTENT_STATUS_LOADING) { if (c->base.status != CONTENT_STATUS_LOADING) {
union content_msg_data data = event->data; union content_msg_data data = event->data;
if (c->had_initial_layout == false) {
break;
}
if (!box_visible(box)) if (!box_visible(box))
break; break;