From 13d56c2822be71dba9933c62ffd2c4ca8bf5658e Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Wed, 26 Nov 2014 18:39:38 -0700 Subject: [PATCH] servo: Merge #4114 - Fix layout on google search results (from glennw:table-layout-fix); r=pcwalton Source-Repo: https://github.com/servo/servo Source-Revision: 431644bfc8208b613bf69a89826376ffb143cb58 --- servo/components/layout/table.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/servo/components/layout/table.rs b/servo/components/layout/table.rs index 72f11d66fbf9..20bc19c91fc6 100644 --- a/servo/components/layout/table.rs +++ b/servo/components/layout/table.rs @@ -265,12 +265,9 @@ impl Flow for TableFlow { // if there are any, or among all the columns if all are specified. if total_column_inline_size < content_inline_size && num_unspecified_inline_sizes == 0 { - let extra_column_inline_size = content_inline_size; - (content_inline_size - total_column_inline_size) / - (self.column_inline_sizes.len() as i32); + let ratio = content_inline_size.to_subpx() / total_column_inline_size.to_subpx(); for column_inline_size in self.column_inline_sizes.iter_mut() { - column_inline_size.minimum_length = column_inline_size.minimum_length + - extra_column_inline_size; + column_inline_size.minimum_length = column_inline_size.minimum_length.scale_by(ratio); column_inline_size.percentage = 0.0; } } else if num_unspecified_inline_sizes != 0 {