diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-12-04 16:23:33 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-04 16:23:33 -0500 |
commit | e70397d90aef6af1f14952cd22839bb0a4a1f072 (patch) | |
tree | 3992153170142a5b78daa4105bba555a0722cc7c /components/layout_2020/flow/float.rs | |
parent | 951dc2419af2aa4c9e79e42c73e74db54bdeb7ba (diff) | |
parent | dd9dfc66e324748ffce14be5df9ac61258941653 (diff) | |
download | servo-e70397d90aef6af1f14952cd22839bb0a4a1f072.tar.gz servo-e70397d90aef6af1f14952cd22839bb0a4a1f072.zip |
Auto merge of #25033 - servo:intrinsic, r=nox
Add support for inline-block and for computing min/max-content
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, + ), + } + } +} |