mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Auto merge of #15271 - mbrubeck:root, r=notriddle
Initialize block_container_inline_size for non-block root flows Fixes #14948. Fixes #14945. Needs a try run. r? @notriddle <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15271) <!-- Reviewable:end -->
This commit is contained in:
commit
fdf0833ec2
8 changed files with 137 additions and 6 deletions
|
@ -1701,6 +1701,19 @@ impl BlockFlow {
|
|||
|
||||
self.base.floats = Floats::new(self.base.writing_mode);
|
||||
|
||||
self.initialize_container_size_for_root(shared_context);
|
||||
|
||||
// Our inline-size was set to the inline-size of the containing block by the flow's parent.
|
||||
// Now compute the real value.
|
||||
self.propagate_and_compute_used_inline_size(shared_context);
|
||||
|
||||
self.guess_inline_size_for_block_formatting_context_if_necessary()
|
||||
}
|
||||
|
||||
/// If this is the root flow, initialize values that would normally be set by the parent.
|
||||
///
|
||||
/// Should be called during `assign_inline_sizes` for flows that may be the root.
|
||||
pub fn initialize_container_size_for_root(&mut self, shared_context: &SharedStyleContext) {
|
||||
if self.is_root() {
|
||||
debug!("Setting root position");
|
||||
self.base.position.start = LogicalPoint::zero(self.base.writing_mode);
|
||||
|
@ -1708,12 +1721,6 @@ impl BlockFlow {
|
|||
self.base.writing_mode, shared_context.viewport_size).inline;
|
||||
self.base.block_container_writing_mode = self.base.writing_mode;
|
||||
}
|
||||
|
||||
// Our inline-size was set to the inline-size of the containing block by the flow's parent.
|
||||
// Now compute the real value.
|
||||
self.propagate_and_compute_used_inline_size(shared_context);
|
||||
|
||||
self.guess_inline_size_for_block_formatting_context_if_necessary()
|
||||
}
|
||||
|
||||
fn guess_inline_size_for_block_formatting_context_if_necessary(&mut self) {
|
||||
|
|
|
@ -868,6 +868,8 @@ impl Flow for FlexFlow {
|
|||
return
|
||||
}
|
||||
|
||||
self.block_flow.initialize_container_size_for_root(shared_context);
|
||||
|
||||
// Our inline-size was set to the inline-size of the containing block by the flow's parent.
|
||||
// Now compute the real value.
|
||||
let containing_block_inline_size = self.block_flow.base.block_container_inline_size;
|
||||
|
|
|
@ -341,6 +341,8 @@ impl Flow for TableWrapperFlow {
|
|||
"table_wrapper"
|
||||
});
|
||||
|
||||
self.block_flow.initialize_container_size_for_root(shared_context);
|
||||
|
||||
let mut intermediate_column_inline_sizes = self.column_intrinsic_inline_sizes
|
||||
.iter()
|
||||
.map(|column_intrinsic_inline_size| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue