Author: tlsa
Date: Wed Mar 2 11:50:51 2011
New Revision: 11886
URL:
http://source.netsurf-browser.org?rev=11886&view=rev
Log:
Make box flags and move new line indicator to it.
Modified:
trunk/netsurf/render/box.c
trunk/netsurf/render/box.h
trunk/netsurf/render/html_redraw.c
trunk/netsurf/render/layout.c
Modified: trunk/netsurf/render/box.c
URL:
http://source.netsurf-browser.org/trunk/netsurf/render/box.c?rev=11886&am...
==============================================================================
--- trunk/netsurf/render/box.c (original)
+++ trunk/netsurf/render/box.c Wed Mar 2 11:50:51 2011
@@ -131,6 +131,7 @@
talloc_set_destructor(box, free_box_style);
box->type = BOX_INLINE;
+ box->flags = 0;
box->styles = styles;
box->style = style;
box->style_owned = style_owned;
@@ -156,7 +157,6 @@
box->columns = 1;
box->rows = 1;
box->start_column = 0;
- box->inline_new_line = false;
box->printed = false;
box->next = NULL;
box->prev = NULL;
Modified: trunk/netsurf/render/box.h
URL:
http://source.netsurf-browser.org/trunk/netsurf/render/box.h?rev=11886&am...
==============================================================================
--- trunk/netsurf/render/box.h (original)
+++ trunk/netsurf/render/box.h Wed Mar 2 11:50:51 2011
@@ -115,6 +115,12 @@
BOX_INLINE_END, BOX_NONE
} box_type;
+
+/** Type of a struct box. */
+typedef enum {
+ NEW_LINE = 1 << 0 /* first inline on a new line */
+} box_flags;
+
/* Sides of a box */
enum box_side { TOP, RIGHT, BOTTOM, LEFT };
@@ -131,6 +137,9 @@
struct box {
/** Type of box. */
box_type type;
+
+ /** Box flags */
+ box_flags flags;
/** Computed styles for elements and their pseudo elements. NULL on
* non-element boxes. */
@@ -219,7 +228,6 @@
/** INLINE_END box corresponding to this INLINE box, or INLINE box
* corresponding to this INLINE_END box. */
struct box *inline_end;
- bool inline_new_line;
/** First float child box, or 0. Float boxes are in the tree twice, in
* this list for the block box which defines the area for floats, and
Modified: trunk/netsurf/render/html_redraw.c
URL:
http://source.netsurf-browser.org/trunk/netsurf/render/html_redraw.c?rev=...
==============================================================================
--- trunk/netsurf/render/html_redraw.c (original)
+++ trunk/netsurf/render/html_redraw.c Wed Mar 2 11:50:51 2011
@@ -528,7 +528,7 @@
ib_b_right = ib->border[RIGHT].width * scale;
}
- if (ib->inline_new_line && ib != box) {
+ if ((ib->flags & NEW_LINE) && ib != box) {
/* inline element has wrapped, plot background
* and borders */
if (!html_redraw_inline_background(
Modified: trunk/netsurf/render/layout.c
URL:
http://source.netsurf-browser.org/trunk/netsurf/render/layout.c?rev=11886...
==============================================================================
--- trunk/netsurf/render/layout.c (original)
+++ trunk/netsurf/render/layout.c Wed Mar 2 11:50:51 2011
@@ -2560,7 +2560,7 @@
}
for (d = first; d != b; d = d->next) {
- d->inline_new_line = false;
+ d->flags &= ~NEW_LINE;
if (d->type == BOX_INLINE_BLOCK &&
(css_computed_position(d->style) ==
@@ -2601,7 +2601,7 @@
}
}
- first->inline_new_line = true;
+ first->flags |= NEW_LINE;
assert(b != first || (move_y && 0 < used_height && (left ||
right)));