Author: tlsa
Date: Wed Jan 21 17:01:59 2009
New Revision: 6162

URL: http://source.netsurf-browser.org?rev=6162&view=rev
Log:
Fix placement of tables in normal flow next to floats. This stops big blank 
gaps appearing e.g. at the top of wikipedia articles, on some google search 
results and on amazon product pages.

Modified:
    trunk/netsurf/render/layout.c

Modified: trunk/netsurf/render/layout.c
URL: 
http://source.netsurf-browser.org/trunk/netsurf/render/layout.c?rev=6162&r1=6161&r2=6162&view=diff
==============================================================================
--- trunk/netsurf/render/layout.c (original)
+++ trunk/netsurf/render/layout.c Wed Jan 21 17:01:59 2009
@@ -344,7 +344,16 @@
                        layout_block_add_scrollbar(box, RIGHT);
                        layout_block_add_scrollbar(box, BOTTOM);
                } else if (box->type == BOX_TABLE) {
-                       if (!layout_table(box, box->parent->width, content))
+                       if (box->style->width.width == CSS_WIDTH_AUTO) {
+                               int x0, x1;
+                               struct box *left, *right;
+                               x0 = cx;
+                               x1 = cx + box->parent->width;
+                               find_sides(block->float_children, cy, cy,
+                                               &x0, &x1, &left, &right);
+                               available_width = x1 - x0 > 0 ? x1 - x0 : 0;
+                       }
+                       if (!layout_table(box, available_width, content))
                                return false;
                        layout_solve_width(box->parent->width, box->width,
                                        -1, -1, box->margin, box->padding,
@@ -438,6 +447,8 @@
                                find_sides(block->float_children, y,
                                                y + box->height,
                                                &x0, &x1, &left, &right);
+                               if (box->style->width.width == CSS_WIDTH_AUTO)
+                                       break;
                                if (box->width <= x1 - x0)
                                        break;
                                if (!left && !right)


_______________________________________________
netsurf-commits mailing list
[email protected]
http://vlists.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to