Auto merge of #8337 - mrobinson:remove-display-list-result, r=pcwalton

Remove DisplayListBuildingResult

Always produce a DisplayList when processing nodes for display list
construction. StackingContexts are now added to the positioned content
section of DisplayLists. This makes the code a bit simpler and opens up
the possibility of producing a StackingContext in another section of
the DisplayList. This doesn't change behavior, but is a cleanup
prerequisite for proper inline stacking context support.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8337)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-11-06 05:36:35 +05:30
commit da25b8c848
4 changed files with 50 additions and 70 deletions

View file

@ -28,13 +28,12 @@
use app_units::Au;
use block::BlockFlow;
use context::LayoutContext;
use display_list_builder::DisplayListBuildingResult;
use euclid::{Point2D, Rect, Size2D};
use floats::Floats;
use flow_list::{FlowList, FlowListIterator, MutFlowListIterator};
use flow_ref::{self, FlowRef, WeakFlowRef};
use fragment::{Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo};
use gfx::display_list::ClippingRegion;
use gfx::display_list::{ClippingRegion, DisplayList};
use incremental::{self, RECONSTRUCT_FLOW, REFLOW, REFLOW_OUT_OF_FLOW, RestyleDamage};
use inline::InlineFlow;
use model::{CollapsibleMargins, IntrinsicISizes, MarginCollapseInfo};
@ -897,7 +896,7 @@ pub struct BaseFlow {
pub stacking_relative_position_of_display_port: Rect<Au>,
/// The results of display list building for this flow.
pub display_list_building_result: DisplayListBuildingResult,
pub display_list_building_result: Option<Box<DisplayList>>,
/// The writing mode for this flow.
pub writing_mode: WritingMode,
@ -1043,7 +1042,7 @@ impl BaseFlow {
block_container_writing_mode: writing_mode,
block_container_explicit_block_size: None,
absolute_cb: ContainingBlockLink::new(),
display_list_building_result: DisplayListBuildingResult::None,
display_list_building_result: None,
early_absolute_position_info: EarlyAbsolutePositionInfo::new(writing_mode),
late_absolute_position_info: LateAbsolutePositionInfo::new(),
clip: ClippingRegion::max(),
@ -1074,11 +1073,8 @@ impl BaseFlow {
let bounds = Rect::new(self.stacking_relative_position, position_with_overflow.size);
let all_items = match self.display_list_building_result {
DisplayListBuildingResult::None => Vec::new(),
DisplayListBuildingResult::StackingContext(ref stacking_context) => {
stacking_context.display_list.flatten()
}
DisplayListBuildingResult::Normal(ref display_list) => display_list.flatten(),
Some(ref display_list) => display_list.flatten(),
None => Vec::new(),
};
for item in &all_items {