aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/block.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2019-12-15 22:12:10 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2019-12-16 14:23:56 +0100
commit7d30a7da750141bb0ca20b236271b41167ee225b (patch)
tree3b41496c0c91a2659123134f3d5e146bcbe3a773 /components/layout/block.rs
parentc1c2b746c829a9d2266a181e35170300680e6636 (diff)
downloadservo-7d30a7da750141bb0ca20b236271b41167ee225b.tar.gz
servo-7d30a7da750141bb0ca20b236271b41167ee225b.zip
Servo build fixes.
Diffstat (limited to 'components/layout/block.rs')
-rw-r--r--components/layout/block.rs22
1 files changed, 12 insertions, 10 deletions
diff --git a/components/layout/block.rs b/components/layout/block.rs
index 80c0fae2243..24413a31f4e 100644
--- a/components/layout/block.rs
+++ b/components/layout/block.rs
@@ -2029,7 +2029,7 @@ impl BlockFlow {
// If `max-width` is set, then don't perform this speculation. We guess that the
// page set `max-width` in order to avoid hitting floats. The search box on Google
// SERPs falls into this category.
- if self.fragment.style.max_inline_size() != MaxSize::None {
+ if !matches!(self.fragment.style.max_inline_size(), MaxSize::None) {
return;
}
@@ -2548,8 +2548,8 @@ impl Flow for BlockFlow {
.base
.flags
.contains(FlowFlags::IS_ABSOLUTELY_POSITIONED) &&
- self.fragment.style().logical_position().inline_start == LengthPercentageOrAuto::Auto &&
- self.fragment.style().logical_position().inline_end == LengthPercentageOrAuto::Auto
+ self.fragment.style().logical_position().inline_start.is_auto() &&
+ self.fragment.style().logical_position().inline_end.is_auto()
{
self.base.position.start.i = inline_position
}
@@ -2560,8 +2560,8 @@ impl Flow for BlockFlow {
.base
.flags
.contains(FlowFlags::IS_ABSOLUTELY_POSITIONED) &&
- self.fragment.style().logical_position().block_start == LengthPercentageOrAuto::Auto &&
- self.fragment.style().logical_position().block_end == LengthPercentageOrAuto::Auto
+ self.fragment.style().logical_position().block_start.is_auto() &&
+ self.fragment.style().logical_position().block_end.is_auto()
{
self.base.position.start.b = block_position
}
@@ -2848,16 +2848,18 @@ pub trait ISizeAndMarginsComputer {
parent_flow_inline_size: Au,
shared_context: &SharedStyleContext,
) -> MaybeAuto {
+ let inline_size = self.containing_block_inline_size(
+ block,
+ parent_flow_inline_size,
+ shared_context,
+ );
+
MaybeAuto::from_option(
block
.fragment()
.style()
.content_inline_size()
- .to_used_value(self.containing_block_inline_size(
- block,
- parent_flow_inline_size,
- shared_context,
- )),
+ .to_used_value(inline_size),
)
}