Make some of layout_2020 private

This commit is contained in:
Simon Sapin 2019-10-04 17:51:05 +02:00
parent ec74204fa0
commit 1bb85ed05b
10 changed files with 43 additions and 41 deletions

View file

@ -123,7 +123,7 @@ struct BlockContainerBuilder<'dom, 'style, Node> {
}
impl BlockContainer {
pub(crate) fn construct<'dom, 'style>(
pub fn construct<'dom, 'style>(
context: &SharedStyleContext<'style>,
block_container_style: &Arc<ComputedValues>,
contents: NonReplacedContents<impl NodeExt<'dom>>,
@ -646,7 +646,7 @@ where
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum ContainsFloats {
pub(crate) enum ContainsFloats {
No,
Yes,
}

View file

@ -7,7 +7,7 @@ use servo_arc::Arc;
use style::properties::ComputedValues;
#[derive(Debug)]
pub struct FloatBox {
pub(crate) struct FloatBox {
pub style: Arc<ComputedValues>,
pub contents: IndependentFormattingContext,
}

View file

@ -16,12 +16,12 @@ use style::values::computed::Length;
use style::Zero;
#[derive(Debug, Default)]
pub struct InlineFormattingContext {
pub(crate) struct InlineFormattingContext {
pub(super) inline_level_boxes: Vec<Arc<InlineLevelBox>>,
}
#[derive(Debug)]
pub enum InlineLevelBox {
pub(crate) enum InlineLevelBox {
InlineBox(InlineBox),
TextRun(TextRun),
OutOfFlowAbsolutelyPositionedBox(AbsolutelyPositionedBox),
@ -34,7 +34,7 @@ pub enum InlineLevelBox {
}
#[derive(Debug)]
pub struct InlineBox {
pub(crate) struct InlineBox {
pub style: Arc<ComputedValues>,
pub first_fragment: bool,
pub last_fragment: bool,
@ -43,7 +43,7 @@ pub struct InlineBox {
/// https://www.w3.org/TR/css-display-3/#css-text-run
#[derive(Debug)]
pub struct TextRun {
pub(crate) struct TextRun {
pub parent_style: Arc<ComputedValues>,
pub text: String,
}

View file

@ -25,22 +25,24 @@ use style::Zero;
mod construct;
mod float;
pub mod inline;
pub mod root;
mod root;
pub use root::BoxTreeRoot;
#[derive(Debug)]
pub struct BlockFormattingContext {
pub(crate) struct BlockFormattingContext {
pub contents: BlockContainer,
pub contains_floats: bool,
}
#[derive(Debug)]
pub enum BlockContainer {
pub(crate) enum BlockContainer {
BlockLevelBoxes(Vec<Arc<BlockLevelBox>>),
InlineFormattingContext(InlineFormattingContext),
}
#[derive(Debug)]
pub enum BlockLevelBox {
pub(crate) enum BlockLevelBox {
SameFormattingContextBlock {
style: Arc<ComputedValues>,
contents: BlockContainer,

View file

@ -22,7 +22,6 @@ use style::properties::ComputedValues;
use style::values::computed::{Length, LengthOrAuto};
use style_traits::CSSPixel;
#[derive(Debug)]
pub struct BoxTreeRoot(BlockFormattingContext);
impl BoxTreeRoot {