private static void ApplyBackgroundSize(IList <IList <String> > backgroundProperties, float em, float rem, int
                                                imageIndex, BackgroundImage image)
        {
            if (backgroundProperties == null || backgroundProperties.IsEmpty())
            {
                return;
            }
            if (image.GetForm() != null && (image.GetImageHeight() == 0f || image.GetImageWidth() == 0f))
            {
                return;
            }
            IList <String> backgroundSizeValues = backgroundProperties[GetBackgroundSidePropertyIndex(backgroundProperties
                                                                                                      .Count, imageIndex)];

            if (backgroundSizeValues.Count == 2 && CommonCssConstants.AUTO.Equals(backgroundSizeValues[1]))
            {
                backgroundSizeValues.JRemoveAt(1);
            }
            if (backgroundSizeValues.Count == 1)
            {
                String widthValue = backgroundSizeValues[0];
                ApplyBackgroundWidth(widthValue, image, em, rem);
            }
            if (backgroundSizeValues.Count == 2)
            {
                ApplyBackgroundWidthHeight(backgroundSizeValues, image, em, rem);
            }
        }