mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
layout: Don't use BlockFlow::assign_block_size()
when assigning flex
flows' block sizes. This ensures that we never collapse margins for flex flows.
This commit is contained in:
parent
1ab56c0ccd
commit
3d645a9253
1 changed files with 6 additions and 4 deletions
|
@ -7,7 +7,7 @@
|
|||
#![deny(unsafe_code)]
|
||||
|
||||
use app_units::{Au, MAX_AU};
|
||||
use block::BlockFlow;
|
||||
use block::{BlockFlow, MarginsMayCollapseFlag};
|
||||
use context::{LayoutContext, SharedLayoutContext};
|
||||
use display_list_builder::{DisplayListBuildState, FlexFlowDisplayListBuilding};
|
||||
use euclid::Point2D;
|
||||
|
@ -648,7 +648,7 @@ impl FlexFlow {
|
|||
}
|
||||
|
||||
// TODO(zentner): This function should actually flex elements!
|
||||
fn block_mode_assign_block_size<'a>(&mut self, layout_context: &'a LayoutContext<'a>) {
|
||||
fn block_mode_assign_block_size(&mut self) {
|
||||
let mut cur_b = if !self.main_reverse {
|
||||
self.block_flow.fragment.border_padding.block_start
|
||||
} else {
|
||||
|
@ -666,7 +666,6 @@ impl FlexFlow {
|
|||
base.position.start.b = cur_b;
|
||||
}
|
||||
}
|
||||
self.block_flow.assign_block_size(layout_context)
|
||||
}
|
||||
|
||||
fn inline_mode_assign_block_size<'a>(&mut self, layout_context: &'a LayoutContext<'a>) {
|
||||
|
@ -927,7 +926,10 @@ impl Flow for FlexFlow {
|
|||
}
|
||||
|
||||
fn assign_block_size<'a>(&mut self, layout_context: &'a LayoutContext<'a>) {
|
||||
self.block_flow.assign_block_size(layout_context);
|
||||
self.block_flow
|
||||
.assign_block_size_block_base(layout_context,
|
||||
None,
|
||||
MarginsMayCollapseFlag::MarginsMayNotCollapse);
|
||||
match self.main_mode {
|
||||
Direction::Inline => self.inline_mode_assign_block_size(layout_context),
|
||||
Direction::Block => self.block_mode_assign_block_size(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue