aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/flow/float.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-12-04 16:23:33 -0500
committerGitHub <noreply@github.com>2019-12-04 16:23:33 -0500
commite70397d90aef6af1f14952cd22839bb0a4a1f072 (patch)
tree3992153170142a5b78daa4105bba555a0722cc7c /components/layout_2020/flow/float.rs
parent951dc2419af2aa4c9e79e42c73e74db54bdeb7ba (diff)
parentdd9dfc66e324748ffce14be5df9ac61258941653 (diff)
downloadservo-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.rs26
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,
+ ),
+ }
+ }
+}