/**
         * Also taking into account the CSS properties of any parent tag in the given tag.
         *
         * @see com.itextpdf.tool.xml.pipeline.css.CSSResolver#resolveStyles(com.itextpdf.tool.xml.Tag)
         */

        //THE DIFFERENCE BETWEEN HTML AND SVG: SVG has for a lot of style properties the possibility to use still attributes that define the same
        public void ResolveStyles(Tag t)
        {
            // get css for this tag from resolver
            IDictionary <String, String> tagCss = new Dictionary <String, String>();

            if (null != cssFiles && cssFiles.HasFiles())
            {
                tagCss = cssFiles.GetCSS(t);
            }

            if (null != t.Attributes && t.Attributes.Count > 0)
            {
                //first get the attributes that related to style but aren't in a style attribute, these can be overwritten by the same element that is defined in a style
                //TODO check default values & incorrect values:
                //e.g. stroke="red" style="stroke:yellow" -> yellow but stroke="red" style="stroke:an non-existing color" -> red
                //if both are wrong or missing -> take from parent

                foreach (KeyValuePair <String, String> pair in t.Attributes)
                {
                    bool valid = SVGAttributes.IsValidAttribute(pair.Key, pair.Value, attributes);
                    if (valid)
                    {
                        tagCss[pair.Key] = pair.Value;
                    }
                }

                // get css from "style" attr
                String styleAtt;
                if (t.Attributes.TryGetValue(HTML.Attribute.STYLE, out styleAtt) && !string.IsNullOrEmpty(styleAtt))
                {
                    String[] styles = styleAtt.Split(new Char[] { ';' });
                    foreach (String s in styles)
                    {
                        String[] part = s.Split(new Char[] { ':' }, 2);
                        if (part.Length == 2)
                        {
                            String key   = part[0].Trim();
                            String value = utils.StripDoubleSpacesAndTrim(part[1]);

                            //ONLY add when it is a valid style attribute in SVG
                            if (SVGAttributes.IsValidAttribute(key, value, attributes))
                            {
                                tagCss[key] = value;
                            }
                            else
                            {
                                //System.out.Println(key + " " + value);
                            }

                            //splitRules(tagCss, key, value);
                        }
                    }
                }
            }
            // inherit css from parent tags, as defined in provided CssInheritanceRules or if property = inherit
            IDictionary <String, String> css = t.CSS;

            if (MustInherit(t.Name) && null != t.Parent && null != t.Parent.CSS)
            {
                if (null != this.inherit)
                {
                    foreach (KeyValuePair <String, String> entry in t.Parent.CSS)
                    {
                        String key = entry.Key;
                        if ((tagCss.ContainsKey(key) && CSS.Value.INHERIT.Equals(tagCss.ContainsKey(key) ? tagCss[key] : null)) || CanInherite(t, key))
                        {
                            //splitRules(css, key, entry.GetValue());

                            if (SVGAttributes.IsValidAttribute(key, entry.Value, attributes))
                            {
                                css[key] = entry.Value;
                            }
                        }
                    }
                }
                else
                {
                    CssUtils.MapPutAll(css, t.Parent.CSS);
                }
            }
            // overwrite properties (if value != inherit)
            foreach (KeyValuePair <String, String> e in tagCss)
            {
                if (!Util.EqualsIgnoreCase(CSS.Value.INHERIT, e.Value))
                {
                    css[e.Key] = e.Value;
                }
            }
        }