use of com.codename1.xml.Element in project CodenameOne by codenameone.
the class CSSEngine method applyStyle.
/**
* Applies the given style attributes to the HTML DOM entry
*
* @param element The element to apply the style to
* @param selector The selector containing the style directives
* @param htmlC The HTMLComponent
*/
private void applyStyle(HTMLElement element, CSSElement selector, HTMLComponent htmlC) {
if ((element.getUi() != null) && (element.getUi().size() > 0)) {
if (!HTMLComponent.PROCESS_HTML_MP1_ONLY) {
String reset = selector.getAttributeById(CSSElement.CSS_COUNTER_RESET);
if (reset != null) {
htmlC.incCounter(reset, true);
}
String inc = selector.getAttributeById(CSSElement.CSS_COUNTER_INCREMENT);
if (inc != null) {
htmlC.incCounter(inc, false);
}
if ((selector.getSelectorPseudoClass() & (CSSElement.PC_BEFORE | CSSElement.PC_AFTER)) != 0) {
handleContentProperty(element, selector, htmlC);
return;
}
}
for (int iter = 0; iter < element.getUi().size(); iter++) {
Object o = element.getUi().elementAt(iter);
if (o != null && o instanceof Component) {
final Component cmp = (Component) o;
applyStyleToUIElement(cmp, selector, element, htmlC);
}
}
}
}
Aggregations