mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Make NodeExt private in layout_2020
This commit is contained in:
parent
10eccc8beb
commit
24b7eadfff
2 changed files with 8 additions and 4 deletions
|
@ -284,7 +284,7 @@ impl Drop for BoxSlot<'_> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait NodeExt<'dom>: 'dom + Copy + LayoutNode + Send + Sync {
|
pub(crate) trait NodeExt<'dom>: 'dom + Copy + LayoutNode + Send + Sync {
|
||||||
fn is_element(self) -> bool;
|
fn is_element(self) -> bool;
|
||||||
fn as_text(self) -> Option<String>;
|
fn as_text(self) -> Option<String>;
|
||||||
fn first_child(self) -> Option<Self>;
|
fn first_child(self) -> Option<Self>;
|
||||||
|
|
|
@ -19,6 +19,7 @@ use crate::style_ext::{
|
||||||
};
|
};
|
||||||
use crate::{ContainingBlock, DefiniteContainingBlock};
|
use crate::{ContainingBlock, DefiniteContainingBlock};
|
||||||
use rayon::iter::{IntoParallelRefIterator, ParallelExtend, ParallelIterator};
|
use rayon::iter::{IntoParallelRefIterator, ParallelExtend, ParallelIterator};
|
||||||
|
use script_layout_interface::wrapper_traits::LayoutNode;
|
||||||
use servo_arc::Arc;
|
use servo_arc::Arc;
|
||||||
use style::context::SharedStyleContext;
|
use style::context::SharedStyleContext;
|
||||||
use style::properties::ComputedValues;
|
use style::properties::ComputedValues;
|
||||||
|
@ -30,10 +31,13 @@ pub struct BoxTreeRoot(BlockFormattingContext);
|
||||||
pub struct FragmentTreeRoot(Vec<Fragment>);
|
pub struct FragmentTreeRoot(Vec<Fragment>);
|
||||||
|
|
||||||
impl BoxTreeRoot {
|
impl BoxTreeRoot {
|
||||||
pub fn construct<'dom>(
|
pub fn construct<'dom, Node>(
|
||||||
context: &SharedStyleContext<'_>,
|
context: &SharedStyleContext<'_>,
|
||||||
root_element: impl NodeExt<'dom>,
|
root_element: Node,
|
||||||
) -> Self {
|
) -> Self
|
||||||
|
where
|
||||||
|
Node: 'dom + Copy + LayoutNode + Send + Sync,
|
||||||
|
{
|
||||||
let (contains_floats, boxes) = construct_for_root_element(&context, root_element);
|
let (contains_floats, boxes) = construct_for_root_element(&context, root_element);
|
||||||
Self(BlockFormattingContext {
|
Self(BlockFormattingContext {
|
||||||
contains_floats: contains_floats == ContainsFloats::Yes,
|
contains_floats: contains_floats == ContainsFloats::Yes,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue