mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
2020: add and call Fragment::build_display_list
This commit is contained in:
parent
e38cc1a549
commit
4e8eeda976
3 changed files with 42 additions and 12 deletions
|
@ -6,7 +6,7 @@ use crate::dom_traversal::{Contents, NodeExt};
|
|||
use crate::flow::construct::ContainsFloats;
|
||||
use crate::flow::float::FloatBox;
|
||||
use crate::flow::{BlockContainer, BlockFormattingContext, BlockLevelBox};
|
||||
use crate::fragments::Fragment;
|
||||
use crate::fragments::{Fragment, IsContentful};
|
||||
use crate::geom;
|
||||
use crate::geom::flow_relative::Vec2;
|
||||
use crate::positioned::AbsolutelyPositionedBox;
|
||||
|
@ -21,6 +21,7 @@ use style::context::SharedStyleContext;
|
|||
use style::properties::ComputedValues;
|
||||
use style::values::computed::{Length, LengthOrAuto};
|
||||
use style_traits::CSSPixel;
|
||||
use webrender_api::DisplayListBuilder;
|
||||
|
||||
pub struct BoxTreeRoot(BlockFormattingContext);
|
||||
pub struct FragmentTreeRoot(Vec<Fragment>);
|
||||
|
@ -129,3 +130,13 @@ impl BoxTreeRoot {
|
|||
FragmentTreeRoot(flow_children.fragments)
|
||||
}
|
||||
}
|
||||
|
||||
impl FragmentTreeRoot {
|
||||
pub fn build_display_list(&self, builder: &mut DisplayListBuilder) -> IsContentful {
|
||||
let mut is_contentful = IsContentful(false);
|
||||
for fragment in &self.0 {
|
||||
fragment.build_display_list(builder, &mut is_contentful)
|
||||
}
|
||||
is_contentful
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue