summaryrefslogtreecommitdiff
path: root/content/handlers/html/redraw.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2020-05-12 21:09:41 +0100
committerVincent Sanders <vince@kyllikki.org>2020-05-12 21:09:41 +0100
commit3c7538a9f906e38e78be0300049f9e49839d7fd7 (patch)
tree318e996390f05db954969b2eb9cb71760f118e75 /content/handlers/html/redraw.c
parenta8596a80aeb70acb05aba29f654df24210f50c19 (diff)
downloadnetsurf-3c7538a9f906e38e78be0300049f9e49839d7fd7.tar.gz
netsurf-3c7538a9f906e38e78be0300049f9e49839d7fd7.tar.bz2
hoist common text search out of content handlers
Diffstat (limited to 'content/handlers/html/redraw.c')
-rw-r--r--content/handlers/html/redraw.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/content/handlers/html/redraw.c b/content/handlers/html/redraw.c
index f9fb6b4fd..aa99782c7 100644
--- a/content/handlers/html/redraw.c
+++ b/content/handlers/html/redraw.c
@@ -167,7 +167,6 @@ text_redraw(const char *utf8_text,
bool excluded,
struct content *c,
const struct selection *sel,
- struct textsearch_context *search,
const struct redraw_context *ctx)
{
bool highlighted = false;
@@ -195,8 +194,8 @@ text_redraw(const char *utf8_text,
/* what about the current search operation, if any? */
if (!highlighted &&
- (search != NULL) &&
- content_textsearch_ishighlighted(search,
+ (c->textsearch.context != NULL) &&
+ content_textsearch_ishighlighted(c->textsearch.context,
offset,
offset + len,
&start_idx,
@@ -1138,11 +1137,19 @@ static bool html_redraw_text_box(const html_content *html, struct box *box,
font_plot_style_from_css(&html->len_ctx, box->style, &fstyle);
fstyle.background = current_background_color;
- if (!text_redraw(box->text, box->length, box->byte_offset,
- box->space, &fstyle, x, y,
- clip, box->height, scale, excluded,
- (struct content *)html, &html->sel,
- html->search, ctx))
+ if (!text_redraw(box->text,
+ box->length,
+ box->byte_offset,
+ box->space,
+ &fstyle,
+ x, y,
+ clip,
+ box->height,
+ scale,
+ excluded,
+ (struct content *)html,
+ &html->sel,
+ ctx))
return false;
return true;