aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/flow/root.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout_2020/flow/root.rs')
-rw-r--r--components/layout_2020/flow/root.rs24
1 files changed, 20 insertions, 4 deletions
diff --git a/components/layout_2020/flow/root.rs b/components/layout_2020/flow/root.rs
index ba473abc410..54cc1eef07f 100644
--- a/components/layout_2020/flow/root.rs
+++ b/components/layout_2020/flow/root.rs
@@ -2,11 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
+use crate::display_list::IsContentful;
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, IsContentful};
+use crate::fragments::Fragment;
use crate::geom;
use crate::geom::flow_relative::Vec2;
use crate::positioned::AbsolutelyPositionedBox;
@@ -20,8 +21,8 @@ use servo_arc::Arc;
use style::context::SharedStyleContext;
use style::properties::ComputedValues;
use style::values::computed::{Length, LengthOrAuto};
+use style::Zero;
use style_traits::CSSPixel;
-use webrender_api::DisplayListBuilder;
pub struct BoxTreeRoot(BlockFormattingContext);
pub struct FragmentTreeRoot(Vec<Fragment>);
@@ -132,10 +133,25 @@ impl BoxTreeRoot {
}
impl FragmentTreeRoot {
- pub fn build_display_list(&self, builder: &mut DisplayListBuilder) -> IsContentful {
+ pub fn build_display_list(
+ &self,
+ builder: &mut crate::display_list::DisplayListBuilder,
+ pipeline_id: msg::constellation_msg::PipelineId,
+ viewport_size: webrender_api::units::LayoutSize,
+ ) -> IsContentful {
+ let containing_block = geom::physical::Rect {
+ top_left: geom::physical::Vec2 {
+ x: Length::zero(),
+ y: Length::zero(),
+ },
+ size: geom::physical::Vec2 {
+ x: Length::new(viewport_size.width),
+ y: Length::new(viewport_size.height),
+ },
+ };
let mut is_contentful = IsContentful(false);
for fragment in &self.0 {
- fragment.build_display_list(builder, &mut is_contentful)
+ fragment.build_display_list(builder, &mut is_contentful, &containing_block)
}
is_contentful
}