mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Generate ::before and ::after content from url() for layout2020
This commit is contained in:
parent
756cf66cd2
commit
dc9a33f3a9
5 changed files with 46 additions and 6 deletions
|
@ -271,10 +271,11 @@ where
|
|||
})
|
||||
}
|
||||
|
||||
/// https://www.w3.org/TR/CSS2/generate.html#propdef-content
|
||||
fn generate_pseudo_element_content<'dom, Node>(
|
||||
pseudo_element_style: &ComputedValues,
|
||||
element: Node,
|
||||
_context: &LayoutContext,
|
||||
context: &LayoutContext,
|
||||
) -> Vec<PseudoElementContentItem>
|
||||
where
|
||||
Node: NodeExt<'dom>,
|
||||
|
@ -298,6 +299,13 @@ where
|
|||
attr_val.map_or("".to_string(), |s| s.to_string()),
|
||||
));
|
||||
},
|
||||
ContentItem::Url(image_url) => {
|
||||
if let Some(replaced_content) =
|
||||
ReplacedContent::from_image_url(element, context, image_url)
|
||||
{
|
||||
vec.push(PseudoElementContentItem::Replaced(replaced_content));
|
||||
}
|
||||
},
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue