Source:
public void applyStyles(Object element, boolean applyStylesToChildNodes, boolean computeDefaultStyle) { Element elt = getElement(element); if (elt == null || !isVisible(elt)) { return; } CSSStyleDeclaration style = viewCSS.getComputedStyle(elt, null); if (computeDefaultStyle) { if (applyStylesToChildNodes) { this.computeDefaultStyle = computeDefaultStyle; } applyDefaultStyleDeclaration(element, false, style, null); } String[] pseudoInstances = getStaticPseudoInstances(elt); if (pseudoInstances != null && pseudoInstances.length > 0) { for (String pseudoInstance : pseudoInstances) { CSSStyleDeclaration styleWithPseudoInstance = viewCSS.getComputedStyle(elt, pseudoInstance); if (computeDefaultStyle) { applyDefaultStyleDeclaration(element, false, styleWithPseudoInstance, pseudoInstance); } if (styleWithPseudoInstance != null) { CSSRule parentRule = styleWithPseudoInstance.getParentRule(); if (parentRule instanceof ExtendedCSSRule) { applyConditionalPseudoStyle((ExtendedCSSRule) parentRule, pseudoInstance, element, styleWithPseudoInstance); } else { applyStyleDeclaration(elt, styleWithPseudoInstance, pseudoInstance); } } } } if (style != null) { applyStyleDeclaration(elt, style, null); } try { applyInlineStyle(elt, false); } catch (Exception e) { handleExceptions(e); } if (applyStylesToChildNodes) { NodeList nodes = elt instanceof ChildVisibilityAwareElement ? ((ChildVisibilityAwareElement) elt).getVisibleChildNodes() : elt.getChildNodes(); if (nodes != null) { if (nodes instanceof IStreamingNodeList) { ((IStreamingNodeList) nodes).stream().forEach(child -> { applyStyles(child, applyStylesToChildNodes); }); } else { int length = nodes.getLength(); for (int k = 0; k < length; k++) { applyStyles(nodes.item(k), applyStylesToChildNodes); } } onStylesAppliedToChildNodes(elt, nodes); } } }

Target:
public void applyStyles(Object element, boolean applyStylesToChildNodes, boolean computeDefaultStyle) { Element elt = getElement(element); if (elt == null || !isVisible(elt)) { return; } CSSStyleDeclaration style = viewCSS.getComputedStyle(elt, null); if (computeDefaultStyle) { if (applyStylesToChildNodes) { this.computeDefaultStyle = computeDefaultStyle; } applyDefaultStyleDeclaration(element, false, style, null); } String[] pseudoInstances = getStaticPseudoInstances(elt); if (pseudoInstances != null && pseudoInstances.length > 0) { for (String pseudoInstance : pseudoInstances) { CSSStyleDeclaration styleWithPseudoInstance = viewCSS.getComputedStyle(elt, pseudoInstance); if (computeDefaultStyle) { applyDefaultStyleDeclaration(element, false, styleWithPseudoInstance, pseudoInstance); } if (styleWithPseudoInstance != null) { CSSRule parentRule = styleWithPseudoInstance.getParentRule(); if (parentRule instanceof ExtendedCSSRule) { applyConditionalPseudoStyle((ExtendedCSSRule) parentRule, pseudoInstance, element, styleWithPseudoInstance); } else { applyStyleDeclaration(elt, styleWithPseudoInstance, pseudoInstance); } } } } if (style != null) { applyStyleDeclaration(elt, style, null); } try { applyInlineStyle(elt, false); } catch (Exception e) { handleExceptions(e); } if (applyStylesToChildNodes) { NodeList nodes = elt instanceof ChildVisibilityAwareElement ? ((ChildVisibilityAwareElement) elt).getVisibleChildNodes() : elt.getChildNodes(); if (nodes != null) { processNodeList(nodes, this::applyStyles, applyStylesToChildNodes); onStylesAppliedToChildNodes(elt, nodes); } } }