summaryrefslogtreecommitdiff
path: root/render/layout.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-09-23 15:48:40 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-09-23 15:48:40 +0000
commitb0ea2a46e922722025b6e267f2cccc3dbce54e68 (patch)
tree35fc2bce63aacb3e651c9f3819d413cc586faa88 /render/layout.c
parent1385dea0292aa7d5627e7f9e711d8d3d3e407567 (diff)
downloadnetsurf-b0ea2a46e922722025b6e267f2cccc3dbce54e68.tar.gz
netsurf-b0ea2a46e922722025b6e267f2cccc3dbce54e68.tar.bz2
Use layout_find_dimensions to get inline object width/height.
svn path=/trunk/netsurf/; revision=12866
Diffstat (limited to 'render/layout.c')
-rw-r--r--render/layout.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/render/layout.c b/render/layout.c
index a55793e89..0fdeb7e01 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -2256,8 +2256,6 @@ bool layout_line(struct box *first, int *width, int *y,
#endif
for (x = 0, b = first; x <= x1 - x0 && b != 0; b = b->next) {
- enum css_width_e wtype;
- enum css_height_e htype;
css_fixed value = 0;
css_unit unit = CSS_UNIT_PX;
@@ -2414,27 +2412,9 @@ bool layout_line(struct box *first, int *width, int *y,
/* inline replaced, 10.3.2 and 10.6.2 */
assert(b->style);
- /* calculate box width */
- wtype = css_computed_width(b->style, &value, &unit);
- if (wtype == CSS_WIDTH_SET) {
- if (unit == CSS_UNIT_PCT) {
- b->width = FPCT_OF_INT_TOINT(value, *width);
- } else {
- b->width = FIXTOINT(nscss_len2px(value, unit,
- b->style));
- }
- } else {
- b->width = AUTO;
- }
-
- /* height */
- htype = css_computed_height(b->style, &value, &unit);
- if (htype == CSS_HEIGHT_SET) {
- b->height = FIXTOINT(nscss_len2px(value, unit,
- b->style));
- } else {
- b->height = AUTO;
- }
+ layout_find_dimensions(*width, -1, b, b->style,
+ &b->width, &b->height, NULL, NULL,
+ NULL, NULL, NULL);
if (b->object && !(b->flags & REPLACE_DIM)) {
layout_get_object_dimensions(b, &b->width, &b->height,
@@ -2462,7 +2442,8 @@ bool layout_line(struct box *first, int *width, int *y,
if (b->object && content_get_type(b->object) == CONTENT_HTML &&
b->width !=
content_get_available_width(b->object)) {
- htype = css_computed_height(b->style, &value, &unit);
+ enum css_height_e htype = css_computed_height(b->style,
+ &value, &unit);
content_reformat(b->object, false, b->width, b->height);