Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/c3d6099250475d40a8b5c...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/c3d6099250475d40a8b5c9c...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/c3d6099250475d40a8b5c9c54...
The branch, master has been updated
via c3d6099250475d40a8b5c9c548ac8858e9d7b5ac (commit)
from c9bf72a4a30da996fc84ee6df8416a3e929ad28f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=c3d6099250475d40a8b...
commit c3d6099250475d40a8b5c9c548ac8858e9d7b5ac
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Redraws during layout are prohibited, and redundant.
diff --git a/render/box_textarea.c b/render/box_textarea.c
index fe5a7ba..a1bbb53 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 12c173f..36f6e80 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 e030e57..279eb40 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 05a085e..28522dc 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;
-----------------------------------------------------------------------
Summary of changes:
render/box_textarea.c | 7 +++++++
render/html.c | 5 +++++
render/html_interaction.c | 7 +++++++
render/html_internal.h | 3 +++
4 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/render/box_textarea.c b/render/box_textarea.c
index fe5a7ba..a1bbb53 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 12c173f..36f6e80 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 e030e57..279eb40 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 05a085e..28522dc 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;
--
NetSurf Browser