layout: Unify the block-size computation for blocks and floats.

The float code was old and did not support most of CSS 2.1. So unifying
the two paths both simplifies code and improves functionality.

Improves the Reddit sidebar.
This commit is contained in:
Patrick Walton 2014-09-24 10:07:39 -07:00
parent c2d6d8084c
commit 9f4c2de211
6 changed files with 86 additions and 140 deletions

View file

@ -282,7 +282,7 @@ impl Flow for TableWrapperFlow {
// Now compute the real value.
let containing_block_inline_size = self.block_flow.base.position.size.inline;
if self.is_float() {
self.block_flow.float.get_mut_ref().containing_inline_size =
self.block_flow.float.as_mut().unwrap().containing_inline_size =
containing_block_inline_size;
}