layout: Prepare for bidi by guarding all access to writing-mode (#33082)

We want to selectively enable right-to-left writing modes per layout
context. This change makes that possible by allowing access to
`writing-mode` though an interface that always returns the default
horizontal top-to-bottom (implicitly left-to-right) writing mode.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
This commit is contained in:
Martin Robinson 2024-08-16 13:38:04 +02:00 committed by GitHub
parent 3d3621b652
commit 0d94a8acd2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 129 additions and 88 deletions

View file

@ -976,7 +976,8 @@ impl FloatBox {
);
children = replaced.contents.make_fragments(
&replaced.style,
content_size.to_physical_size(containing_block.style.writing_mode),
content_size
.to_physical_size(containing_block.effective_writing_mode()),
)
},
};
@ -986,7 +987,7 @@ impl FloatBox {
size: content_size,
};
let containing_block_writing_mode = containing_block.style.writing_mode;
let containing_block_writing_mode = containing_block.effective_writing_mode();
BoxFragment::new(
self.contents.base_fragment_info(),
style.clone(),