diff options
Diffstat (limited to 'components/layout_2020/flow/float.rs')
-rw-r--r-- | components/layout_2020/flow/float.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/components/layout_2020/flow/float.rs b/components/layout_2020/flow/float.rs index f9be366bc97..2acc2095004 100644 --- a/components/layout_2020/flow/float.rs +++ b/components/layout_2020/flow/float.rs @@ -2,7 +2,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ +use crate::context::LayoutContext; +use crate::dom_traversal::{Contents, NodeExt}; use crate::formatting_contexts::IndependentFormattingContext; +use crate::sizing::ContentSizesRequest; +use crate::style_ext::{ComputedValuesExt, DisplayInside}; +use servo_arc::Arc; +use style::properties::ComputedValues; #[derive(Debug)] pub(crate) struct FloatBox { @@ -19,3 +25,23 @@ impl FloatContext { FloatContext {} } } + +impl FloatBox { + pub fn construct<'dom>( + context: &LayoutContext, + style: Arc<ComputedValues>, + display_inside: DisplayInside, + contents: Contents<impl NodeExt<'dom>>, + ) -> Self { + let content_sizes = ContentSizesRequest::inline_if(style.inline_size_is_auto()); + Self { + contents: IndependentFormattingContext::construct( + context, + style, + display_inside, + contents, + content_sizes, + ), + } + } +} |