mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Factor out BlockFlow::background_border_section()
This commit is contained in:
parent
836e59e5b6
commit
f3531d1d35
3 changed files with 23 additions and 19 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue