Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/3c3685eb9635cc46fe78b31d54967b62b948581e
...commit
http://git.netsurf-browser.org/netsurf.git/commit/3c3685eb9635cc46fe78b31d54967b62b948581e
...tree
http://git.netsurf-browser.org/netsurf.git/tree/3c3685eb9635cc46fe78b31d54967b62b948581e
The branch, master has been updated
via 3c3685eb9635cc46fe78b31d54967b62b948581e (commit)
via 473a40bc114d70d84610d40b425cf1e9bc548359 (commit)
via af554fcedf8a3c209350ccb1acfd5b233081bd18 (commit)
from d884e0e53303c22e747c8d769189e21785b7f753 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=3c3685eb9635cc46fe78b31d54967b62b948581e
commit 3c3685eb9635cc46fe78b31d54967b62b948581e
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Layout: Percentage max-width constrained boxes don't affect min on minmax
pass.
diff --git a/render/layout.c b/render/layout.c
index b1d5557..121137a 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -503,6 +503,23 @@ static void layout_minmax_table(struct box *table,
assert(0 <= table->min_width && table->min_width <= table->max_width);
}
+/**
+ * Helper to check if a box has percentage max width.
+ *
+ * \param[in] b Box to check.
+ * \return true iff box has percnetage max width.
+ */
+static inline bool box_has_percentage_max_width(struct box *b)
+{
+ css_unit unit = CSS_UNIT_PX;
+ enum css_max_width_e type;
+ css_fixed value = 0;
+
+ assert(b != NULL);
+
+ type = css_computed_max_width(b->style, &value, &unit);
+ return ((type == CSS_MAX_WIDTH_SET) && (unit == CSS_UNIT_PCT));
+}
/**
* Calculate minimum and maximum width of a line.
@@ -834,7 +851,7 @@ layout_minmax_line(struct box *first,
b->style));
}
- if (min < width)
+ if (min < width && !box_has_percentage_max_width(b))
min = width;
if (width > 0)
max += width;
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=473a40bc114d70d84610d40b425cf1e9bc548359
commit 473a40bc114d70d84610d40b425cf1e9bc548359
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Layout: Fix min max pass calc that looked wrong.
The `width` variable call be set to AUTO, which is INT_MIN,
so we can't add it to max without checking it's > 0, or we'll
blunder into the minmax assertions.
diff --git a/render/layout.c b/render/layout.c
index 59fa0c9..b1d5557 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -836,7 +836,8 @@ layout_minmax_line(struct box *first,
if (min < width)
min = width;
- max += width;
+ if (width > 0)
+ max += width;
*line_has_height = true;
}
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=af554fcedf8a3c209350ccb1acfd5b233081bd18
commit af554fcedf8a3c209350ccb1acfd5b233081bd18
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Layout: Remove some commented out code.
diff --git a/render/layout.c b/render/layout.c
index f6b774a..59fa0c9 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -730,10 +730,6 @@ layout_minmax_line(struct box *first,
bs = css_computed_box_sizing(block->style);
if (wtype == CSS_WIDTH_SET) {
if (unit == CSS_UNIT_PCT) {
- /*
- b->width = FPCT_OF_INT_TOINT(value, width);
- */
-
width = AUTO;
} else {
width = FIXTOINT(nscss_len2px(&content->len_ctx,
-----------------------------------------------------------------------
Summary of changes:
render/layout.c | 26 ++++++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/render/layout.c b/render/layout.c
index f6b774a..121137a 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -503,6 +503,23 @@ static void layout_minmax_table(struct box *table,
assert(0 <= table->min_width && table->min_width <= table->max_width);
}
+/**
+ * Helper to check if a box has percentage max width.
+ *
+ * \param[in] b Box to check.
+ * \return true iff box has percnetage max width.
+ */
+static inline bool box_has_percentage_max_width(struct box *b)
+{
+ css_unit unit = CSS_UNIT_PX;
+ enum css_max_width_e type;
+ css_fixed value = 0;
+
+ assert(b != NULL);
+
+ type = css_computed_max_width(b->style, &value, &unit);
+ return ((type == CSS_MAX_WIDTH_SET) && (unit == CSS_UNIT_PCT));
+}
/**
* Calculate minimum and maximum width of a line.
@@ -730,10 +747,6 @@ layout_minmax_line(struct box *first,
bs = css_computed_box_sizing(block->style);
if (wtype == CSS_WIDTH_SET) {
if (unit == CSS_UNIT_PCT) {
- /*
- b->width = FPCT_OF_INT_TOINT(value, width);
- */
-
width = AUTO;
} else {
width = FIXTOINT(nscss_len2px(&content->len_ctx,
@@ -838,9 +851,10 @@ layout_minmax_line(struct box *first,
b->style));
}
- if (min < width)
+ if (min < width && !box_has_percentage_max_width(b))
min = width;
- max += width;
+ if (width > 0)
+ max += width;
*line_has_height = true;
}
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org