mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
layout: Add a new MARGINS_CANNOT_COLLAPSE
flow flag.
This commit is contained in:
parent
be252371ea
commit
b809aae74b
2 changed files with 7 additions and 2 deletions
|
@ -36,7 +36,7 @@ use floats::{ClearType, FloatKind, Floats, PlacementInfo};
|
||||||
use flow::{self, BaseFlow, EarlyAbsolutePositionInfo, Flow, FlowClass, ForceNonfloatedFlag};
|
use flow::{self, BaseFlow, EarlyAbsolutePositionInfo, Flow, FlowClass, ForceNonfloatedFlag};
|
||||||
use flow::{BLOCK_POSITION_IS_STATIC, CLEARS_LEFT, CLEARS_RIGHT};
|
use flow::{BLOCK_POSITION_IS_STATIC, CLEARS_LEFT, CLEARS_RIGHT};
|
||||||
use flow::{CONTAINS_TEXT_OR_REPLACED_FRAGMENTS, INLINE_POSITION_IS_STATIC};
|
use flow::{CONTAINS_TEXT_OR_REPLACED_FRAGMENTS, INLINE_POSITION_IS_STATIC};
|
||||||
use flow::{FragmentationContext, PreorderFlowTraversal};
|
use flow::{FragmentationContext, MARGINS_CANNOT_COLLAPSE, PreorderFlowTraversal};
|
||||||
use flow::{ImmutableFlowUtils, LateAbsolutePositionInfo, MutableFlowUtils, OpaqueFlow};
|
use flow::{ImmutableFlowUtils, LateAbsolutePositionInfo, MutableFlowUtils, OpaqueFlow};
|
||||||
use flow::IS_ABSOLUTELY_POSITIONED;
|
use flow::IS_ABSOLUTELY_POSITIONED;
|
||||||
use flow_list::FlowList;
|
use flow_list::FlowList;
|
||||||
|
@ -1911,7 +1911,9 @@ impl Flow for BlockFlow {
|
||||||
self.fragment.restyle_damage.remove(REFLOW_OUT_OF_FLOW | REFLOW);
|
self.fragment.restyle_damage.remove(REFLOW_OUT_OF_FLOW | REFLOW);
|
||||||
}
|
}
|
||||||
None
|
None
|
||||||
} else if self.is_root() || self.formatting_context_type() != FormattingContextType::None {
|
} else if self.is_root() ||
|
||||||
|
self.formatting_context_type() != FormattingContextType::None ||
|
||||||
|
self.base.flags.contains(MARGINS_CANNOT_COLLAPSE) {
|
||||||
// Root element margins should never be collapsed according to CSS § 8.3.1.
|
// Root element margins should never be collapsed according to CSS § 8.3.1.
|
||||||
debug!("assign_block_size: assigning block_size for root flow {:?}",
|
debug!("assign_block_size: assigning block_size for root flow {:?}",
|
||||||
flow::base(self).debug_id());
|
flow::base(self).debug_id());
|
||||||
|
|
|
@ -665,6 +665,9 @@ bitflags! {
|
||||||
|
|
||||||
/// Whether this flow contains any text and/or replaced fragments.
|
/// Whether this flow contains any text and/or replaced fragments.
|
||||||
const CONTAINS_TEXT_OR_REPLACED_FRAGMENTS = 0b0001_0000_0000_0000_0000_0000,
|
const CONTAINS_TEXT_OR_REPLACED_FRAGMENTS = 0b0001_0000_0000_0000_0000_0000,
|
||||||
|
|
||||||
|
/// Whether margins are prohibited from collapsing with this flow.
|
||||||
|
const MARGINS_CANNOT_COLLAPSE = 0b0010_0000_0000_0000_0000_0000,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue