mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +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
|
@ -7,18 +7,14 @@ use style::properties::style_structs;
|
|||
use style::values::computed::Image;
|
||||
|
||||
use crate::context::LayoutContext;
|
||||
use crate::dom::NodeExt;
|
||||
use crate::dom_traversal::{NodeAndStyleInfo, PseudoElementContentItem};
|
||||
use crate::replaced::ReplacedContents;
|
||||
|
||||
/// <https://drafts.csswg.org/css-lists/#content-property>
|
||||
pub(crate) fn make_marker<'dom, Node>(
|
||||
pub(crate) fn make_marker<'dom>(
|
||||
context: &LayoutContext,
|
||||
info: &NodeAndStyleInfo<Node>,
|
||||
) -> Option<(NodeAndStyleInfo<Node>, Vec<PseudoElementContentItem>)>
|
||||
where
|
||||
Node: NodeExt<'dom>,
|
||||
{
|
||||
info: &NodeAndStyleInfo<'dom>,
|
||||
) -> Option<(NodeAndStyleInfo<'dom>, Vec<PseudoElementContentItem>)> {
|
||||
let marker_info = info.pseudo(context, style::selector_parser::PseudoElement::Marker)?;
|
||||
let style = &marker_info.style;
|
||||
let list_style = style.get_list();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue