summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
Diffstat (limited to 'render')
-rw-r--r--render/box_textarea.c7
-rw-r--r--render/html.c5
-rw-r--r--render/html_interaction.c7
-rw-r--r--render/html_internal.h3
4 files changed, 22 insertions, 0 deletions
diff --git a/render/box_textarea.c b/render/box_textarea.c
index fe5a7bab1..a1bbb539e 100644
--- a/render/box_textarea.c
+++ b/render/box_textarea.c
@@ -155,6 +155,13 @@ static void box_textarea_callback(void *data, struct textarea_msg *msg)
{
/* Request redraw of the required textarea rectangle */
int x, y;
+
+ if (html->reflowing == true) {
+ /* Can't redraw during layout, and it will
+ * be redrawn after layout anyway. */
+ break;
+ }
+
box_coords(box, &x, &y);
content__request_redraw((struct content *)html,
diff --git a/render/html.c b/render/html.c
index 12c173f0d..36f6e807d 100644
--- a/render/html.c
+++ b/render/html.c
@@ -738,6 +738,7 @@ html_create_html_data(html_content *c, const http_parameter *params)
c->base_target = NULL;
c->aborted = false;
c->refresh = false;
+ c->reflowing = false;
c->title = NULL;
c->bctx = NULL;
c->layout = NULL;
@@ -1263,6 +1264,8 @@ static void html_reformat(struct content *c, int width, int height)
time_before = wallclock();
+ htmlc->reflowing = true;
+
layout_document(htmlc, width, height);
layout = htmlc->layout;
@@ -1282,6 +1285,8 @@ static void html_reformat(struct content *c, int width, int height)
selection_reinit(&htmlc->sel, htmlc->layout);
+ htmlc->reflowing = false;
+
time_taken = wallclock() - time_before;
c->reformat_time = wallclock() +
((time_taken * 3 < nsoption_uint(min_reflow_period) ?
diff --git a/render/html_interaction.c b/render/html_interaction.c
index e030e570d..279eb4058 100644
--- a/render/html_interaction.c
+++ b/render/html_interaction.c
@@ -1154,6 +1154,13 @@ void html_overflow_scroll_callback(void *client_data,
switch(scrollbar_data->msg) {
case SCROLLBAR_MSG_MOVED:
+
+ if (html->reflowing == true) {
+ /* Can't redraw during layout, and it will
+ * be redrawn after layout anyway. */
+ break;
+ }
+
html__redraw_a_box(html, box);
break;
case SCROLLBAR_MSG_SCROLL_START:
diff --git a/render/html_internal.h b/render/html_internal.h
index 05a085e22..28522dc93 100644
--- a/render/html_internal.h
+++ b/render/html_internal.h
@@ -94,6 +94,9 @@ typedef struct html_content {
/** Whether a meta refresh has been handled */
bool refresh;
+ /** Whether a layout (reflow) is in progress */
+ bool reflowing;
+
/* Title element node */
dom_node *title;