mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Rustfmt recent changes.
This commit is contained in:
parent
e885ccb7ae
commit
ef16c5844f
28 changed files with 111 additions and 63 deletions
|
@ -2548,8 +2548,16 @@ impl Flow for BlockFlow {
|
|||
.base
|
||||
.flags
|
||||
.contains(FlowFlags::IS_ABSOLUTELY_POSITIONED) &&
|
||||
self.fragment.style().logical_position().inline_start.is_auto() &&
|
||||
self.fragment.style().logical_position().inline_end.is_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,7 +2568,11 @@ impl Flow for BlockFlow {
|
|||
.base
|
||||
.flags
|
||||
.contains(FlowFlags::IS_ABSOLUTELY_POSITIONED) &&
|
||||
self.fragment.style().logical_position().block_start.is_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,11 +2860,8 @@ 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,
|
||||
);
|
||||
let inline_size =
|
||||
self.containing_block_inline_size(block, parent_flow_inline_size, shared_context);
|
||||
|
||||
MaybeAuto::from_option(
|
||||
block
|
||||
|
|
|
@ -91,7 +91,10 @@ fn convert_gradient_stops(
|
|||
color,
|
||||
position: None,
|
||||
}),
|
||||
GradientItem::ComplexColorStop { color, ref position } => Some(ColorStop {
|
||||
GradientItem::ComplexColorStop {
|
||||
color,
|
||||
ref position,
|
||||
} => Some(ColorStop {
|
||||
color,
|
||||
position: Some(position.clone()),
|
||||
}),
|
||||
|
@ -125,7 +128,13 @@ fn convert_gradient_stops(
|
|||
//
|
||||
// FIXME(emilio): Once we know the offsets, it seems like converting the
|
||||
// positions to absolute at once then process that would be cheaper.
|
||||
let mut last_stop_position = stop_items.first().unwrap().position.as_ref().unwrap().clone();
|
||||
let mut last_stop_position = stop_items
|
||||
.first()
|
||||
.unwrap()
|
||||
.position
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.clone();
|
||||
for stop in stop_items.iter_mut().skip(1) {
|
||||
if let Some(ref pos) = stop.position {
|
||||
if position_to_offset(&last_stop_position, total_length) >
|
||||
|
@ -147,8 +156,10 @@ fn convert_gradient_stops(
|
|||
// Initialize a new stop run.
|
||||
// `unwrap()` here should never fail because this is the beginning of
|
||||
// a stop run, which is always bounded by a length or percentage.
|
||||
let start_offset =
|
||||
position_to_offset(stop_items[i - 1].position.as_ref().unwrap(), total_length);
|
||||
let start_offset = position_to_offset(
|
||||
stop_items[i - 1].position.as_ref().unwrap(),
|
||||
total_length,
|
||||
);
|
||||
// `unwrap()` here should never fail because this is the end of
|
||||
// a stop run, which is always bounded by a length or percentage.
|
||||
let (end_index, end_stop) = stop_items[(i + 1)..]
|
||||
|
@ -156,7 +167,8 @@ fn convert_gradient_stops(
|
|||
.enumerate()
|
||||
.find(|&(_, ref stop)| stop.position.is_some())
|
||||
.unwrap();
|
||||
let end_offset = position_to_offset(end_stop.position.as_ref().unwrap(), total_length);
|
||||
let end_offset =
|
||||
position_to_offset(end_stop.position.as_ref().unwrap(), total_length);
|
||||
stop_run = Some(StopRun {
|
||||
start_offset,
|
||||
end_offset,
|
||||
|
|
|
@ -1113,12 +1113,11 @@ impl BaseFlow {
|
|||
self.flags.set(
|
||||
FlowFlags::INLINE_POSITION_IS_STATIC,
|
||||
logical_position.inline_start.is_auto() &&
|
||||
logical_position.inline_end.is_auto()
|
||||
logical_position.inline_end.is_auto(),
|
||||
);
|
||||
self.flags.set(
|
||||
FlowFlags::BLOCK_POSITION_IS_STATIC,
|
||||
logical_position.block_start.is_auto() &&
|
||||
logical_position.block_end.is_auto()
|
||||
logical_position.block_start.is_auto() && logical_position.block_end.is_auto(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2527,10 +2527,20 @@ impl Fragment {
|
|||
{
|
||||
continue;
|
||||
}
|
||||
if !inline_context_node.style.logical_margin().inline_end.is_definitely_zero() {
|
||||
if !inline_context_node
|
||||
.style
|
||||
.logical_margin()
|
||||
.inline_end
|
||||
.is_definitely_zero()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if !inline_context_node.style.logical_padding().inline_end.is_definitely_zero() {
|
||||
if !inline_context_node
|
||||
.style
|
||||
.logical_padding()
|
||||
.inline_end
|
||||
.is_definitely_zero()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if inline_context_node.style.logical_border_width().inline_end != Au(0) {
|
||||
|
@ -2549,10 +2559,20 @@ impl Fragment {
|
|||
{
|
||||
continue;
|
||||
}
|
||||
if !inline_context_node.style.logical_margin().inline_start.is_definitely_zero() {
|
||||
if !inline_context_node
|
||||
.style
|
||||
.logical_margin()
|
||||
.inline_start
|
||||
.is_definitely_zero()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if !inline_context_node.style.logical_padding().inline_start.is_definitely_zero() {
|
||||
if !inline_context_node
|
||||
.style
|
||||
.logical_padding()
|
||||
.inline_start
|
||||
.is_definitely_zero()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if inline_context_node
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue