use of com.gargoylesoftware.css.dom.CSSCharsetRuleImpl in project htmlunit by HtmlUnit.
the class CSSStyleSheet method refreshCssRules.
private void refreshCssRules() {
if (cssRules_ == null) {
return;
}
cssRules_.clearRules();
cssRulesIndexFix_.clear();
final CSSRuleListImpl ruleList = getWrappedSheet().getCssRules();
final List<AbstractCSSRuleImpl> rules = ruleList.getRules();
int pos = 0;
for (final AbstractCSSRuleImpl rule : rules) {
if (rule instanceof CSSCharsetRuleImpl) {
cssRulesIndexFix_.add(pos);
continue;
}
final com.gargoylesoftware.htmlunit.javascript.host.css.CSSRule cssRule = com.gargoylesoftware.htmlunit.javascript.host.css.CSSRule.create(this, rule);
if (null == cssRule) {
cssRulesIndexFix_.add(pos);
} else {
cssRules_.addRule(cssRule);
}
pos++;
}
// reset our index also
getWrappedSheet().resetRuleIndex();
}
use of com.gargoylesoftware.css.dom.CSSCharsetRuleImpl in project htmlunit by HtmlUnit.
the class CSSGroupingRule method refreshCssRules.
private void refreshCssRules() {
if (cssRules_ == null) {
return;
}
cssRules_.clearRules();
cssRulesIndexFix_.clear();
final CSSRuleListImpl ruleList = getGroupingRule().getCssRules();
final List<AbstractCSSRuleImpl> rules = ruleList.getRules();
int pos = 0;
for (final AbstractCSSRuleImpl rule : rules) {
if (rule instanceof CSSCharsetRuleImpl) {
cssRulesIndexFix_.add(pos);
continue;
}
final CSSRule cssRule = CSSRule.create(getParentStyleSheet(), rule);
if (null == cssRule) {
cssRulesIndexFix_.add(pos);
} else {
cssRules_.addRule(cssRule);
}
pos++;
}
}
Aggregations