diff options
author | bors-servo <infra@servo.org> | 2023-06-19 16:56:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-19 16:56:16 +0200 |
commit | 836ae5fa48b7cb60dd801e6cd20becc1d839e8f5 (patch) | |
tree | aff1c4c315820eff7d29f5900623cc67173d4503 /components/layout_2020/flow/float.rs | |
parent | ffccc5c88b8d47efc777b0bc9d2620bed4bc84d7 (diff) | |
parent | 4ec6dd17836493aa479ea6ff887cd628bd1711e3 (diff) | |
download | servo-836ae5fa48b7cb60dd801e6cd20becc1d839e8f5.tar.gz servo-836ae5fa48b7cb60dd801e6cd20becc1d839e8f5.zip |
Auto merge of #29887 - Loirooriol:float-inline-size-complete, r=mrobinson
Handle floats in BlockContainer::inline_content_sizes
Typically, block-level contents are stacked vertically, so this was just taking the maximum size among all contents. However, floats can be stacked horizontally, so we need to sum their sizes.
<!-- Please describe your changes on the following line: -->
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #29874
<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because ___
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Diffstat (limited to 'components/layout_2020/flow/float.rs')
-rw-r--r-- | components/layout_2020/flow/float.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/components/layout_2020/flow/float.rs b/components/layout_2020/flow/float.rs index 9a52b50853d..5750ed6039d 100644 --- a/components/layout_2020/flow/float.rs +++ b/components/layout_2020/flow/float.rs @@ -690,12 +690,7 @@ impl FloatBox { .floats .lower_ceiling(sequential_layout_state.current_block_position_including_margins()); - let style = match self.contents { - IndependentFormattingContext::Replaced(ref replaced) => replaced.style.clone(), - IndependentFormattingContext::NonReplaced(ref non_replaced) => { - non_replaced.style.clone() - }, - }; + let style = self.contents.style().clone(); let float_context = &mut sequential_layout_state.floats; let box_fragment = positioning_context.layout_maybe_position_relative_fragment( layout_context, |