Factor out BlockFlow::background_border_section()

This commit is contained in:
Manish Goregaokar 2018-02-14 12:47:31 -08:00
parent 836e59e5b6
commit f3531d1d35
3 changed files with 23 additions and 19 deletions

View file

@ -38,6 +38,7 @@ use flow::{BaseFlow, EarlyAbsolutePositionInfo, Flow, FlowClass, ForceNonfloated
use flow::{ImmutableFlowUtils, LateAbsolutePositionInfo, OpaqueFlow, FragmentationContext, FlowFlags};
use flow_list::FlowList;
use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, Overflow, FragmentFlags};
use gfx::display_list::DisplayListSection;
use gfx_traits::print_tree::PrintTree;
use incremental::RelayoutMode;
use layout_debug;
@ -1794,6 +1795,23 @@ impl BlockFlow {
as_margins.to_physical(writing_mode)
}
pub fn background_border_section(&self) -> DisplayListSection {
if self.base.flags.is_float() {
DisplayListSection::BackgroundAndBorders
} else if self.base
.flags
.contains(FlowFlags::IS_ABSOLUTELY_POSITIONED)
{
if self.fragment.establishes_stacking_context() {
DisplayListSection::BackgroundAndBorders
} else {
DisplayListSection::BlockBackgroundsAndBorders
}
} else {
DisplayListSection::BlockBackgroundsAndBorders
}
}
}
impl Flow for BlockFlow {