Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/f7a0135300ead08731fe10a63891a12cc2dbe067
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/f7a0135300ead08731fe10a63891a12cc2dbe067
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/f7a0135300ead08731fe10a63891a12cc2dbe067

The branch, master has been updated
       via  f7a0135300ead08731fe10a63891a12cc2dbe067 (commit)
       via  73dab84ef8de2f419349aa4c8872704c7ca9122c (commit)
       via  dbd7f5bcd8a6500c7236bbe67e4a38c48a613b20 (commit)
      from  71765dd1e8dc968f15ce359f7e604585aa428f90 (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=f7a0135300ead08731fe10a63891a12cc2dbe067
commit f7a0135300ead08731fe10a63891a12cc2dbe067
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    html: layout: flex: Don't freeze already-frozen items
    
    This fixes an error in the used main size tracking.

diff --git a/content/handlers/html/layout_flex.c 
b/content/handlers/html/layout_flex.c
index 7c295f1..61adcaa 100644
--- a/content/handlers/html/layout_flex.c
+++ b/content/handlers/html/layout_flex.c
@@ -780,6 +780,10 @@ static bool layout_flex__resolve_line(
                for (size_t i = line->first; i < item_count; i++) {
                        struct flex_item_data *item = &ctx->item.data[i];
 
+                       if (item->freeze) {
+                               continue;
+                       }
+
                        if (total_violation == 0 ||
                            (total_violation > 0 && item->min_violation) ||
                            (total_violation < 0 && item->max_violation)) {


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=73dab84ef8de2f419349aa4c8872704c7ca9122c
commit 73dab84ef8de2f419349aa4c8872704c7ca9122c
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    html: layout: flex: shrink: Avoid rounding error accumulation

diff --git a/content/handlers/html/layout_flex.c 
b/content/handlers/html/layout_flex.c
index 3a0fa4a..7c295f1 100644
--- a/content/handlers/html/layout_flex.c
+++ b/content/handlers/html/layout_flex.c
@@ -649,6 +649,7 @@ static inline void layout_flex__distribute_free_main(
                }
        } else {
                css_fixed scaled_shrink_factor_sum = 0;
+               css_fixed remainder = 0;
 
                for (size_t i = line->first; i < item_count; i++) {
                        struct flex_item_data *item = &ctx->item.data[i];
@@ -667,6 +668,7 @@ static inline void layout_flex__distribute_free_main(
                for (size_t i = line->first; i < item_count; i++) {
                        struct flex_item_data *item = &ctx->item.data[i];
                        css_fixed scaled_shrink_factor;
+                       css_fixed result;
                        css_fixed ratio;
 
                        if (item->freeze) {
@@ -681,12 +683,13 @@ static inline void layout_flex__distribute_free_main(
                                        item->shrink,
                                        INTTOFIX(item->base_size));
                        ratio = FDIV(scaled_shrink_factor,
-                                    scaled_shrink_factor_sum);
+                                    scaled_shrink_factor_sum);
+                       result = FMUL(INTTOFIX(abs(remaining_free_main)),
+                                     ratio) + remainder;
 
                        item->target_main_size = item->base_size -
-                                       FIXTOINT(FMUL(
-                                       INTTOFIX(abs(remaining_free_main)),
-                                       ratio));
+                                       FIXTOINT(result);
+                       remainder = FIXFRAC(result);
                }
        }
 }


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=dbd7f5bcd8a6500c7236bbe67e4a38c48a613b20
commit dbd7f5bcd8a6500c7236bbe67e4a38c48a613b20
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    html: layout: flex: grow: Avoid rounding error accumulation

diff --git a/content/handlers/html/layout_flex.c 
b/content/handlers/html/layout_flex.c
index ac0b888..3a0fa4a 100644
--- a/content/handlers/html/layout_flex.c
+++ b/content/handlers/html/layout_flex.c
@@ -629,8 +629,10 @@ static inline void layout_flex__distribute_free_main(
        size_t item_count = line->first + line->count;
 
        if (grow) {
+               css_fixed remainder = 0;
                for (size_t i = line->first; i < item_count; i++) {
                        struct flex_item_data *item = &ctx->item.data[i];
+                       css_fixed result;
                        css_fixed ratio;
 
                        if (item->freeze) {
@@ -638,11 +640,12 @@ static inline void layout_flex__distribute_free_main(
                        }
 
                        ratio = FDIV(item->grow, unfrozen_factor_sum);
+                       result = FMUL(INTTOFIX(remaining_free_main), ratio) +
+                                       remainder;
 
                        item->target_main_size = item->base_size +
-                                       FIXTOINT(FMUL(
-                                       INTTOFIX(remaining_free_main),
-                                       ratio));
+                                       FIXTOINT(result);
+                       remainder = FIXFRAC(result);
                }
        } else {
                css_fixed scaled_shrink_factor_sum = 0;


-----------------------------------------------------------------------

Summary of changes:
 content/handlers/html/layout_flex.c |   24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/content/handlers/html/layout_flex.c 
b/content/handlers/html/layout_flex.c
index ac0b888..61adcaa 100644
--- a/content/handlers/html/layout_flex.c
+++ b/content/handlers/html/layout_flex.c
@@ -629,8 +629,10 @@ static inline void layout_flex__distribute_free_main(
        size_t item_count = line->first + line->count;
 
        if (grow) {
+               css_fixed remainder = 0;
                for (size_t i = line->first; i < item_count; i++) {
                        struct flex_item_data *item = &ctx->item.data[i];
+                       css_fixed result;
                        css_fixed ratio;
 
                        if (item->freeze) {
@@ -638,14 +640,16 @@ static inline void layout_flex__distribute_free_main(
                        }
 
                        ratio = FDIV(item->grow, unfrozen_factor_sum);
+                       result = FMUL(INTTOFIX(remaining_free_main), ratio) +
+                                       remainder;
 
                        item->target_main_size = item->base_size +
-                                       FIXTOINT(FMUL(
-                                       INTTOFIX(remaining_free_main),
-                                       ratio));
+                                       FIXTOINT(result);
+                       remainder = FIXFRAC(result);
                }
        } else {
                css_fixed scaled_shrink_factor_sum = 0;
+               css_fixed remainder = 0;
 
                for (size_t i = line->first; i < item_count; i++) {
                        struct flex_item_data *item = &ctx->item.data[i];
@@ -664,6 +668,7 @@ static inline void layout_flex__distribute_free_main(
                for (size_t i = line->first; i < item_count; i++) {
                        struct flex_item_data *item = &ctx->item.data[i];
                        css_fixed scaled_shrink_factor;
+                       css_fixed result;
                        css_fixed ratio;
 
                        if (item->freeze) {
@@ -678,12 +683,13 @@ static inline void layout_flex__distribute_free_main(
                                        item->shrink,
                                        INTTOFIX(item->base_size));
                        ratio = FDIV(scaled_shrink_factor,
-                                    scaled_shrink_factor_sum);
+                                    scaled_shrink_factor_sum);
+                       result = FMUL(INTTOFIX(abs(remaining_free_main)),
+                                     ratio) + remainder;
 
                        item->target_main_size = item->base_size -
-                                       FIXTOINT(FMUL(
-                                       INTTOFIX(abs(remaining_free_main)),
-                                       ratio));
+                                       FIXTOINT(result);
+                       remainder = FIXFRAC(result);
                }
        }
 }
@@ -774,6 +780,10 @@ static bool layout_flex__resolve_line(
                for (size_t i = line->first; i < item_count; i++) {
                        struct flex_item_data *item = &ctx->item.data[i];
 
+                       if (item->freeze) {
+                               continue;
+                       }
+
                        if (total_violation == 0 ||
                            (total_violation > 0 && item->min_violation) ||
                            (total_violation < 0 && item->max_violation)) {


-- 
NetSurf Browser
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to