layout: Minor tweaks for table layout (#34921)

- Fix a typo in a comment.
 - Get the writing mode of the table in a less convoluted way.
 - Check `is_horizontal()` instead of `!is_vertical()`

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2025-01-09 05:26:03 -08:00 committed by GitHub
parent 76fa456a9a
commit b0d7eaf526
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2101,14 +2101,14 @@ impl<'a> TableLayout<'a> {
// //
// This rectangle is an offset between the row fragment and the other table // This rectangle is an offset between the row fragment and the other table
// part rectangle (row group, column, column group). Everything between them // part rectangle (row group, column, column group). Everything between them
// is laid out in a left-to-right fashion, but respecting the veritcality of // is laid out in a left-to-right fashion, but respecting the verticality of
// the writing mode. This is why below, only the axes are flipped, but the // the writing mode. This is why below, only the axes are flipped, but the
// rectangle is not flipped for RTL. // rectangle is not flipped for RTL.
let make_relative_to_row_start = |mut rect: LogicalRect<Au>| { let make_relative_to_row_start = |mut rect: LogicalRect<Au>| {
rect.start_corner -= row_fragment_layout.rect.start_corner; rect.start_corner -= row_fragment_layout.rect.start_corner;
let writing_mode = row_fragment_layout.containing_block.style.writing_mode; let writing_mode = self.table.style.writing_mode;
PhysicalRect::new( PhysicalRect::new(
if !writing_mode.is_vertical() { if writing_mode.is_horizontal() {
PhysicalPoint::new(rect.start_corner.inline, rect.start_corner.block) PhysicalPoint::new(rect.start_corner.inline, rect.start_corner.block)
} else { } else {
PhysicalPoint::new(rect.start_corner.block, rect.start_corner.inline) PhysicalPoint::new(rect.start_corner.block, rect.start_corner.inline)