mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-10 21:12:01 +03:00
Fix min width to take account of white-space property.
This commit is contained in:
parent
48bd5e1f10
commit
131db5c8da
@ -3065,9 +3065,15 @@ struct box *layout_minmax_line(struct box *first,
|
|||||||
if (!b->object && !(b->flags & IFRAME) && !b->gadget &&
|
if (!b->object && !(b->flags & IFRAME) && !b->gadget &&
|
||||||
!(b->flags & REPLACE_DIM)) {
|
!(b->flags & REPLACE_DIM)) {
|
||||||
/* inline non-replaced, 10.3.1 and 10.6.1 */
|
/* inline non-replaced, 10.3.1 and 10.6.1 */
|
||||||
|
bool no_wrap;
|
||||||
if (!b->text)
|
if (!b->text)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
no_wrap = (css_computed_white_space(b->style) ==
|
||||||
|
CSS_WHITE_SPACE_NOWRAP ||
|
||||||
|
css_computed_white_space(b->style) ==
|
||||||
|
CSS_WHITE_SPACE_PRE);
|
||||||
|
|
||||||
if (b->width == UNKNOWN_WIDTH) {
|
if (b->width == UNKNOWN_WIDTH) {
|
||||||
/** \todo handle errors */
|
/** \todo handle errors */
|
||||||
|
|
||||||
@ -3111,11 +3117,15 @@ struct box *layout_minmax_line(struct box *first,
|
|||||||
max += b->space;
|
max += b->space;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* min = widest word */
|
if (no_wrap) {
|
||||||
if (b->parent->flags & NEED_MIN) {
|
/* can't wrap, so min is the same as max */
|
||||||
|
min = max;
|
||||||
|
|
||||||
|
} else if (b->parent->flags & NEED_MIN) {
|
||||||
/* If we care what the minimum width is,
|
/* If we care what the minimum width is,
|
||||||
* calculate it. (It's only needed if we're
|
* calculate it. (It's only needed if we're
|
||||||
* shrinking-to-fit.) */
|
* shrinking-to-fit.) */
|
||||||
|
/* min = widest single word */
|
||||||
i = 0;
|
i = 0;
|
||||||
do {
|
do {
|
||||||
for (j = i; j != b->length &&
|
for (j = i; j != b->length &&
|
||||||
|
Loading…
Reference in New Issue
Block a user