code: private void updateStyleForElement(RendererState state, SvgElementBase obj)
     {
        boolean  isRootSVG = (obj.parent == null);
        state.style.resetNonInheritingProperties(isRootSVG);
  
        // Apply the styles defined by style attributes on the element
        if (obj.baseStyle != null)
           updateStyle(state, obj.baseStyle);
  
        // Apply the styles from any CSS files or <style> elements
        if (document.hasCSSRules())
        {
           for (CSSParser.Rule rule: document.getCSSRules())
           {
              if (CSSParser.ruleMatch(this.ruleMatchContext, rule.selector, obj)) {
                 updateStyle(state, rule.style);
              }
           }
        }
  
        // Apply the styles defined by the 'style' attribute. They have the highest precedence.
        if (obj.style != null)
           updateStyle(state, obj.style);
     }
docs: ==============================================================================