mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
html: Parse a comma-separated list of faces in the <font>
tag (#32622)
This change parses a comma-separated list of faces in the `<font>` tag and also moves the parsing code from `stylo` to Servo. This means that the servo-specific code can be removed from stylo decreasing the differences between Gecko and Servo's version of `stylo`.
This commit is contained in:
parent
47678a61b9
commit
da2de4fc68
5 changed files with 89 additions and 4 deletions
|
@ -751,19 +751,18 @@ impl<'dom> LayoutElementHelpers<'dom> for LayoutDom<'dom, Element> {
|
|||
));
|
||||
}
|
||||
|
||||
let font_family = if let Some(this) = self.downcast::<HTMLFontElement>() {
|
||||
let font_face = if let Some(this) = self.downcast::<HTMLFontElement>() {
|
||||
this.get_face()
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
if let Some(font_family) = font_family {
|
||||
// FIXME(emilio): This in Gecko parses a whole family list.
|
||||
if let Some(font_face) = font_face {
|
||||
hints.push(from_declaration(
|
||||
shared_lock,
|
||||
PropertyDeclaration::FontFamily(font_family::SpecifiedValue::Values(
|
||||
computed::font::FontFamilyList {
|
||||
list: Box::new([computed::font::SingleFontFamily::from_atom(font_family)]),
|
||||
list: HTMLFontElement::parse_face_attribute(font_face).into_boxed_slice(),
|
||||
},
|
||||
)),
|
||||
));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue