mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #6081 - mbrubeck:table-wrapper-rtl, r=pcwalton
Fixes #6006. r? @pcwalton <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6081) <!-- Reviewable:end -->
This commit is contained in:
commit
3934831da3
4 changed files with 52 additions and 6 deletions
|
@ -190,6 +190,18 @@ impl TableWrapperFlow {
|
||||||
table_border_padding + spacing;
|
table_border_padding + spacing;
|
||||||
self.block_flow.base.position.size.inline = total_used_inline_size +
|
self.block_flow.base.position.size.inline = total_used_inline_size +
|
||||||
table_border_padding + spacing + self.block_flow.fragment.margin.inline_start_end();
|
table_border_padding + spacing + self.block_flow.fragment.margin.inline_start_end();
|
||||||
|
|
||||||
|
let writing_mode = self.block_flow.base.writing_mode;
|
||||||
|
let container_mode = self.block_flow.base.block_container_writing_mode;
|
||||||
|
|
||||||
|
if writing_mode.is_bidi_ltr() != container_mode.is_bidi_ltr() {
|
||||||
|
// If our "start" direction is different from our parent flow, then `border_box.start.i`
|
||||||
|
// depends on `border_box.size.inline`.
|
||||||
|
self.block_flow.fragment.border_box.start.i =
|
||||||
|
self.block_flow.base.block_container_inline_size -
|
||||||
|
self.block_flow.fragment.margin.inline_end -
|
||||||
|
self.block_flow.fragment.border_box.size.inline;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn compute_used_inline_size(
|
fn compute_used_inline_size(
|
||||||
|
@ -314,12 +326,8 @@ impl Flow for TableWrapperFlow {
|
||||||
|
|
||||||
let inline_start_content_edge = self.block_flow.fragment.border_box.start.i;
|
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;
|
let content_inline_size = self.block_flow.fragment.border_box.size.inline;
|
||||||
|
let inline_end_content_edge = self.block_flow.fragment.border_padding.inline_end +
|
||||||
// FIXME (mbrubeck): Test mixed RTL/LTR table layout, make sure this is right.
|
self.block_flow.fragment.margin.inline_end;
|
||||||
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.
|
// In case of fixed layout, column inline-sizes are calculated in table flow.
|
||||||
let assigned_column_inline_sizes = match self.table_layout {
|
let assigned_column_inline_sizes = match self.table_layout {
|
||||||
|
|
|
@ -269,6 +269,7 @@ experimental != overconstrained_block.html overconstrained_block_ref.html
|
||||||
experimental == rtl_body.html rtl_body_ref.html
|
experimental == rtl_body.html rtl_body_ref.html
|
||||||
experimental == rtl_margin_a.html rtl_margin_ref.html
|
experimental == rtl_margin_a.html rtl_margin_ref.html
|
||||||
experimental == rtl_simple.html rtl_simple_ref.html
|
experimental == rtl_simple.html rtl_simple_ref.html
|
||||||
|
experimental == rtl_table_a.html rtl_table_ref.html
|
||||||
== servo_center_a.html servo_center_ref.html
|
== servo_center_a.html servo_center_ref.html
|
||||||
== setattribute_id_restyle_a.html setattribute_id_restyle_b.html
|
== setattribute_id_restyle_a.html setattribute_id_restyle_b.html
|
||||||
== stacking_context_overflow_a.html stacking_context_overflow_ref.html
|
== stacking_context_overflow_a.html stacking_context_overflow_ref.html
|
||||||
|
|
19
tests/ref/rtl_table_a.html
Normal file
19
tests/ref/rtl_table_a.html
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>RTL Table test</title>
|
||||||
|
<style>
|
||||||
|
table { direction: rtl; }
|
||||||
|
td {
|
||||||
|
background: orange;
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table><tr><td></td></tr></table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
18
tests/ref/rtl_table_ref.html
Normal file
18
tests/ref/rtl_table_ref.html
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>RTL Table reference</title>
|
||||||
|
<style>
|
||||||
|
td {
|
||||||
|
background: orange;
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table><tr><td></td></tr></table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue