mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
layout: Use ServoLayoutNode
directly instead of a generic impl
(#36876)
This makes it so that layout is no longer generic on the node type, depending directly on `script`'s `ServoLayoutNode`. In addition to greatly simplifying layout, this is necessary because incremental layout needs to be able to create pseudo-element styles without having a handle on the original `impl LayoutNode`. We feel this is a reasonable tradeoff. Testing: No functional changes, so covered by existing WPT tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
51b95a6246
commit
d5e008fd6a
16 changed files with 217 additions and 309 deletions
|
@ -17,7 +17,6 @@ use super::{InlineBox, InlineBoxIdentifier, InlineBoxes, InlineFormattingContext
|
|||
use crate::PropagatedBoxTreeData;
|
||||
use crate::cell::ArcRefCell;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::dom::NodeExt;
|
||||
use crate::dom_traversal::NodeAndStyleInfo;
|
||||
use crate::flow::float::FloatBox;
|
||||
use crate::formatting_contexts::IndependentFormattingContext;
|
||||
|
@ -225,11 +224,7 @@ impl InlineFormattingContextBuilder {
|
|||
(identifier, block_in_inline_splits)
|
||||
}
|
||||
|
||||
pub(crate) fn push_text<'dom, Node: NodeExt<'dom>>(
|
||||
&mut self,
|
||||
text: Cow<'dom, str>,
|
||||
info: &NodeAndStyleInfo<Node>,
|
||||
) {
|
||||
pub(crate) fn push_text<'dom>(&mut self, text: Cow<'dom, str>, info: &NodeAndStyleInfo<'dom>) {
|
||||
let white_space_collapse = info.style.clone_white_space_collapse();
|
||||
let collapsed = WhitespaceCollapse::new(
|
||||
text.chars(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue