@@ -69,6 +69,7 @@ This file is part of the iText (R) project.
6969import com .itextpdf .styledxmlparser .css .resolve .CssDefaults ;
7070import com .itextpdf .styledxmlparser .css .resolve .CssInheritance ;
7171import com .itextpdf .styledxmlparser .css .resolve .CssPropertyMerger ;
72+ import com .itextpdf .styledxmlparser .css .resolve .IStyleInheritance ;
7273import com .itextpdf .styledxmlparser .css .resolve .shorthand .IShorthandResolver ;
7374import com .itextpdf .styledxmlparser .css .resolve .shorthand .ShorthandResolverFactory ;
7475import com .itextpdf .styledxmlparser .css .util .CssUtils ;
@@ -107,6 +108,11 @@ public class DefaultCssResolver implements ICssResolver {
107108 */
108109 private MediaDeviceDescription deviceDescription ;
109110
111+ /**
112+ * Css inheritance checker
113+ */
114+ private IStyleInheritance cssInheritance = new CssInheritance ();
115+
110116 /**
111117 * The list of fonts.
112118 */
@@ -403,7 +409,7 @@ private CssStyleSheet wrapStyleSheetInMediaQueryIfNecessary(IElementNode headChi
403409 */
404410 private void mergeParentCssDeclaration (Map <String , String > styles , String cssProperty , String parentPropValue , Map <String , String > parentStyles ) {
405411 String childPropValue = styles .get (cssProperty );
406- if ((childPropValue == null && CssInheritance .isInheritable (cssProperty )) || CssConstants .INHERIT .equals (childPropValue )) {
412+ if ((childPropValue == null && cssInheritance .isInheritable (cssProperty )) || CssConstants .INHERIT .equals (childPropValue )) {
407413 if (valueIsOfMeasurement (parentPropValue , CssConstants .EM ) || valueIsOfMeasurement (parentPropValue , CssConstants .EX ) ||
408414 valueIsOfMeasurement (parentPropValue , CssConstants .PERCENTAGE ) && fontSizeDependentPercentage .contains (cssProperty )) {
409415 float absoluteParentFontSize = CssUtils .parseAbsoluteLength (parentStyles .get (CssConstants .FONT_SIZE ));
0 commit comments