summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--desktop/textinput.c2
-rw-r--r--render/box.c3
-rw-r--r--render/box.h6
-rw-r--r--render/html.c2
-rw-r--r--render/layout.c2
5 files changed, 6 insertions, 9 deletions
diff --git a/desktop/textinput.c b/desktop/textinput.c
index be6eb0227..55b81b053 100644
--- a/desktop/textinput.c
+++ b/desktop/textinput.c
@@ -2001,7 +2001,7 @@ struct box *textarea_insert_break(struct browser_window *bw,
box_insert_sibling(text_box, new_br);
memcpy(new_text, text_box, sizeof (struct box));
- new_text->clone = 1;
+ new_text->flags |= CLONE;
new_text->text = text;
memcpy(new_text->text, text_box->text + char_offset,
text_box->length - char_offset);
diff --git a/render/box.c b/render/box.c
index ebe69c34f..275079978 100644
--- a/render/box.c
+++ b/render/box.c
@@ -149,7 +149,6 @@ struct box * box_create(css_select_results *styles, css_computed_style *style,
box->text = NULL;
box->length = 0;
box->space = 0;
- box->clone = 0;
box->href = href;
box->target = target;
box->title = title;
@@ -281,7 +280,7 @@ void box_free(struct box *box)
void box_free_box(struct box *box)
{
- if (!box->clone) {
+ if (!(box->flags & CLONE)) {
if (box->gadget)
form_free_control(box->gadget);
if (box->scroll_x != NULL)
diff --git a/render/box.h b/render/box.h
index 441e3d9f7..7b3cc4a3d 100644
--- a/render/box.h
+++ b/render/box.h
@@ -121,7 +121,8 @@ typedef enum {
NEW_LINE = 1 << 0, /* first inline on a new line */
STYLE_OWNED = 1 << 1, /* style is owned by this box */
PRINTED = 1 << 2, /* box has already been printed */
- PRE_STRIP = 1 << 3 /* PRE tag needing leading newline stripped */
+ PRE_STRIP = 1 << 3, /* PRE tag needing leading newline stripped */
+ CLONE = 1 << 4 /* continuation of previous box from wrapping */
} box_flags;
/* Sides of a box */
@@ -203,9 +204,6 @@ struct box {
/** Width of space after current text (depends on font and size). */
int space;
- /** This box is a continuation of the previous box (eg from line
- * breaking). */
- unsigned int clone : 1;
char *href; /**< Link, or 0. */
const char *target; /**< Link target, or 0. */
diff --git a/render/html.c b/render/html.c
index 71304fde7..4a27ec250 100644
--- a/render/html.c
+++ b/render/html.c
@@ -1540,7 +1540,7 @@ void html_object_done(struct box *box, hlcache_handle *object,
b->max_width = UNKNOWN_MAX_WIDTH;
/* delete any clones of this box */
- while (box->next && box->next->clone) {
+ while (box->next && (box->next->flags & CLONE)) {
/* box_free_box(box->next); */
box->next = box->next->next;
}
diff --git a/render/layout.c b/render/layout.c
index 4a6718fe1..067321708 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -1932,7 +1932,7 @@ static bool layout_text_box_split(struct content *content,
c2 = talloc_memdup(content, split_box, sizeof *c2);
if (!c2)
return false;
- c2->clone = 1;
+ c2->flags |= CLONE;
/* Set remaining text in c2 */
if (split_box->parent->parent->gadget != NULL) {