aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout_2020')
-rw-r--r--components/layout_2020/dom_traversal.rs12
-rw-r--r--components/layout_2020/element_data.rs2
-rw-r--r--components/layout_2020/flow/mod.rs2
-rw-r--r--components/layout_2020/flow/root.rs12
-rw-r--r--components/layout_2020/lib.rs20
5 files changed, 21 insertions, 27 deletions
diff --git a/components/layout_2020/dom_traversal.rs b/components/layout_2020/dom_traversal.rs
index c1ac55c2bfb..3475b4e0eef 100644
--- a/components/layout_2020/dom_traversal.rs
+++ b/components/layout_2020/dom_traversal.rs
@@ -17,7 +17,7 @@ use style::properties::ComputedValues;
use style::selector_parser::PseudoElement;
#[derive(Clone, Copy)]
-pub(super) enum WhichPseudoElement {
+pub enum WhichPseudoElement {
Before,
After,
}
@@ -252,24 +252,24 @@ where
unimplemented!()
}
-pub(super) struct BoxSlot<'dom> {
+pub struct BoxSlot<'dom> {
slot: Option<Arc<AtomicRefCell<Option<LayoutBox>>>>,
marker: marker<&'dom ()>,
}
impl BoxSlot<'_> {
- pub fn new(slot: Arc<AtomicRefCell<Option<LayoutBox>>>) -> Self {
+ pub(crate) fn new(slot: Arc<AtomicRefCell<Option<LayoutBox>>>) -> Self {
*slot.borrow_mut() = None;
let slot = Some(slot);
Self { slot, marker }
}
- pub fn dummy() -> Self {
+ pub(crate) fn dummy() -> Self {
let slot = None;
Self { slot, marker }
}
- pub fn set(mut self, box_: LayoutBox) {
+ pub(crate) fn set(mut self, box_: LayoutBox) {
if let Some(slot) = &mut self.slot {
*slot.borrow_mut() = Some(box_);
}
@@ -284,7 +284,7 @@ impl Drop for BoxSlot<'_> {
}
}
-pub(crate) trait NodeExt<'dom>: 'dom + Copy + LayoutNode + Send + Sync {
+pub trait NodeExt<'dom>: 'dom + Copy + LayoutNode + Send + Sync {
fn is_element(self) -> bool;
fn as_text(self) -> Option<String>;
fn first_child(self) -> Option<Self>;
diff --git a/components/layout_2020/element_data.rs b/components/layout_2020/element_data.rs
index fdf611a76c7..ccd48ac04e3 100644
--- a/components/layout_2020/element_data.rs
+++ b/components/layout_2020/element_data.rs
@@ -8,7 +8,7 @@ use atomic_refcell::AtomicRefCell;
use servo_arc::Arc;
#[derive(Default)]
-pub(crate) struct LayoutDataForElement {
+pub struct LayoutDataForElement {
pub(super) self_box: Arc<AtomicRefCell<Option<LayoutBox>>>,
pub(super) pseudo_elements: Option<Box<PseudoElementBoxes>>,
}
diff --git a/components/layout_2020/flow/mod.rs b/components/layout_2020/flow/mod.rs
index ae92f70822c..189a5aeb436 100644
--- a/components/layout_2020/flow/mod.rs
+++ b/components/layout_2020/flow/mod.rs
@@ -27,6 +27,8 @@ mod float;
pub mod inline;
mod root;
+pub use root::BoxTreeRoot;
+
#[derive(Debug)]
pub(crate) struct BlockFormattingContext {
pub contents: BlockContainer,
diff --git a/components/layout_2020/flow/root.rs b/components/layout_2020/flow/root.rs
index b1a43ae28be..994ce29bb16 100644
--- a/components/layout_2020/flow/root.rs
+++ b/components/layout_2020/flow/root.rs
@@ -22,17 +22,7 @@ use style::properties::ComputedValues;
use style::values::computed::{Length, LengthOrAuto};
use style_traits::CSSPixel;
-// FIXME
-// impl crate::dom::Document {
-// pub(crate) fn layout(
-// &self,
-// viewport: crate::geom::Size<crate::geom::CssPx>,
-// ) -> Vec<Fragment> {
-// BoxTreeRoot::construct(self).layout(viewport)
-// }
-// }
-
-struct BoxTreeRoot(BlockFormattingContext);
+pub struct BoxTreeRoot(BlockFormattingContext);
impl BoxTreeRoot {
pub fn construct<'dom>(
diff --git a/components/layout_2020/lib.rs b/components/layout_2020/lib.rs
index 05a5caa9771..f491411eb3c 100644
--- a/components/layout_2020/lib.rs
+++ b/components/layout_2020/lib.rs
@@ -17,19 +17,21 @@ use style::Zero;
pub mod context;
pub mod data;
-pub mod dom_traversal;
-pub mod element_data;
-pub mod flow;
-pub mod fragments;
-pub mod geom;
-pub mod opaque_node;
-pub mod positioned;
+mod dom_traversal;
+mod element_data;
+mod flow;
+mod fragments;
+mod geom;
+mod opaque_node;
+mod positioned;
pub mod query;
-pub mod replaced;
-pub mod style_ext;
+mod replaced;
+mod style_ext;
pub mod traversal;
pub mod wrapper;
+pub use flow::BoxTreeRoot;
+
use crate::dom_traversal::{Contents, NodeExt};
use crate::flow::{BlockFormattingContext, FlowChildren};
use crate::geom::flow_relative::Vec2;