summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2017-06-02 17:22:57 (GMT)
committer Michael Drake <michael.drake@codethink.co.uk>2017-06-02 17:24:23 (GMT)
commitf855774e1a479941f3cdea919a3e9c4de14dbe6a (patch)
treeb98f8284167f6891a9da87b861b1feb2bb338005
parentc08ef5f984fe785b6e13df204046b455489f8810 (diff)
downloadnetsurf-f855774e1a479941f3cdea919a3e9c4de14dbe6a.tar.gz
netsurf-f855774e1a479941f3cdea919a3e9c4de14dbe6a.tar.bz2
Layout: Prevent negative widths on absolutle positioned boxes.
-rw-r--r--render/layout.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/render/layout.c b/render/layout.c
index d9b108c..6782fdf 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -3206,7 +3206,7 @@ layout_absolute(struct box *box,
/* Adjust for {min|max}-width */
if (max_width >= 0 && width > max_width) width = max_width;
- if (min_width > 0 && width < min_width) width = min_width;
+ if (width < min_width) width = min_width;
right = containing_block->width -
left -
@@ -3267,7 +3267,7 @@ layout_absolute(struct box *box,
/* Adjust for {min|max}-width */
if (max_width >= 0 && width > max_width)
width = max_width;
- if (min_width > 0 && width < min_width)
+ if (width < min_width)
width = min_width;
left = containing_block->width -
@@ -3301,7 +3301,7 @@ layout_absolute(struct box *box,
/* Adjust for {min|max}-width */
if (max_width >= 0 && width > max_width)
width = max_width;
- if (min_width > 0 && width < min_width)
+ if (width < min_width)
width = min_width;
right = containing_block->width -
@@ -3314,7 +3314,7 @@ layout_absolute(struct box *box,
/* Adjust for {min|max}-width */
if (max_width >= 0 && width > max_width)
width = max_width;
- if (min_width > 0 && width < min_width)
+ if (width < min_width)
width = min_width;
left = containing_block->width -
@@ -3333,7 +3333,7 @@ layout_absolute(struct box *box,
/* Adjust for {min|max}-width */
if (max_width >= 0 && width > max_width)
width = max_width;
- if (min_width > 0 && width < min_width)
+ if (width < min_width)
width = min_width;
} else if (left != AUTO && width != AUTO && right == AUTO) {
@@ -3341,7 +3341,7 @@ layout_absolute(struct box *box,
/* Adjust for {min|max}-width */
if (max_width >= 0 && width > max_width)
width = max_width;
- if (min_width > 0 && width < min_width)
+ if (width < min_width)
width = min_width;
right = containing_block->width -