Fixes for positioning of RTL blocks.

This fixes a bug in finding the top left corner of an RTL block in physical
coordinates.  (The old code used the `start` point of the `position` rect,
which is not always the top left.)

It also fixes the setting of `position.start.i` in certain mixed LTR/RTL
cases.

There is still a bug related to `position.size` for RTL blocks with margins.
See the FIXME comments for details.
This commit is contained in:
Matt Brubeck 2015-03-06 10:48:57 -08:00
parent 7bd6cb0091
commit 531bcb12ae
9 changed files with 80 additions and 7 deletions

View file

@ -293,6 +293,12 @@ impl Flow for TableWrapperFlow {
let inline_start_content_edge = self.block_flow.fragment.border_box.start.i;
let content_inline_size = self.block_flow.fragment.border_box.size.inline;
// FIXME (mbrubeck): Test mixed RTL/LTR table layout, make sure this is right.
let inline_end_content_edge = self.block_flow.base.block_container_inline_size -
self.block_flow.fragment.margin.inline_end -
content_inline_size -
inline_start_content_edge;
// In case of fixed layout, column inline-sizes are calculated in table flow.
let assigned_column_inline_sizes = match self.table_layout {
TableLayout::Fixed => None,
@ -310,6 +316,7 @@ impl Flow for TableWrapperFlow {
self.block_flow.propagate_assigned_inline_size_to_children(
layout_context,
inline_start_content_edge,
inline_end_content_edge,
content_inline_size,
None)
}
@ -321,6 +328,7 @@ impl Flow for TableWrapperFlow {
self.block_flow
.propagate_assigned_inline_size_to_children(layout_context,
inline_start_content_edge,
inline_end_content_edge,
content_inline_size,
Some(info));
}