@@ -6,7 +6,7 @@ use crate::values::{
66 percentage:: Percentage
77} ;
88use crate :: traits:: { Parse , ToCss , PropertyHandler } ;
9- use super :: Property ;
9+ use super :: { Property , PropertyId } ;
1010use crate :: declaration:: DeclarationList ;
1111use crate :: printer:: Printer ;
1212
@@ -597,7 +597,7 @@ pub(crate) struct FontHandler {
597597}
598598
599599impl PropertyHandler for FontHandler {
600- fn handle_property ( & mut self , property : & Property , _ : & mut DeclarationList ) -> bool {
600+ fn handle_property ( & mut self , property : & Property , dest : & mut DeclarationList ) -> bool {
601601 use Property :: * ;
602602
603603 macro_rules! property {
@@ -626,6 +626,10 @@ impl PropertyHandler for FontHandler {
626626 self . has_any = true ;
627627 // TODO: reset other properties
628628 }
629+ Unparsed ( val) if is_font_property ( & val. property_id ) => {
630+ self . finalize ( dest) ;
631+ dest. push ( property. clone ( ) ) ;
632+ }
629633 _ => return false
630634 }
631635
@@ -695,3 +699,18 @@ impl PropertyHandler for FontHandler {
695699 }
696700 }
697701}
702+
703+ #[ inline]
704+ fn is_font_property ( property_id : & PropertyId ) -> bool {
705+ match property_id {
706+ PropertyId :: FontFamily |
707+ PropertyId :: FontSize |
708+ PropertyId :: FontStyle |
709+ PropertyId :: FontWeight |
710+ PropertyId :: FontStretch |
711+ PropertyId :: FontVariantCaps |
712+ PropertyId :: LineHeight |
713+ PropertyId :: Font => true ,
714+ _ => false
715+ }
716+ }
0 commit comments