Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign uptable_wrapper.rs: Fix for percentage widths #4598
Conversation
|
Note: I know nothing about table layout and I didn't read the changes. Is this change covered by an existing spec? |
|
I changed some of the existing code to match with the "Column and caption widths influence the final table width as follows: ..." part toward the end of this section of the CSS spec (the end result should be, as the spec describes here that "if the margins of a table are set to '0' and the width to 'auto', the table will not automatically size to fill its containing block. However, once the calculated value of 'width' for the table is found (using the algorithms given below or, when appropriate, some other UA dependent algorithm) then the other parts of section 10.3 do apply"). I'm not 100% confident about my changes since I can't claim to fully understand the layout code, but it seems to work (and I included a new reftest based on the tests in #4421). |
| let available_inline_size = match self.block_flow.fragment.style().content_inline_size() { | ||
| LengthOrPercentageOrAuto::Auto => self.block_flow | ||
| .get_shrink_to_fit_inline_size(available_inline_size), | ||
| // XXX(mttr) This fixes #4421 without breaking our current reftests, but I'm |
This comment has been minimized.
This comment has been minimized.
|
Looks good modulo that one nit! |
|
LGTM, squash the two into one and I'll r+. Thanks! |
|
Got it! |
This comment has been minimized.
This comment has been minimized.
pcwalton
commented on 182f1a0
Jan 11, 2015
|
r+ |
This comment has been minimized.
This comment has been minimized.
jdm
replied
Jan 13, 2015
|
@bors: retry |
This comment has been minimized.
This comment has been minimized.
|
saw approval from pcwalton |
This comment has been minimized.
This comment has been minimized.
|
merging mttr/servo/table_percentage = 182f1a0 into auto |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
some tests failed: |
This comment has been minimized.
This comment has been minimized.
|
saw approval from pcwalton |
This comment has been minimized.
This comment has been minimized.
|
merging mttr/servo/table_percentage = 182f1a0 into auto |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
all tests pass: |
This comment has been minimized.
This comment has been minimized.
|
fast-forwarding master to auto = 62d1761 |
182f1a0
into
servo:master
mttr commentedJan 9, 2015
Fixes #4421