use of org.w3c.dom.css.CSSCharsetRule in project webtools.sourceediting by eclipse.
the class CSSCharsetRuleTest method testInsertRule.
public void testInsertRule() {
CSSStyleSheet sheet = getStyleSheet();
assertEquals(0, sheet.insertRule(RULE, 0));
CSSRuleList ruleList = sheet.getCssRules();
CSSRule rule = ruleList.item(0);
assertTrue(rule instanceof CSSCharsetRule);
CSSCharsetRule charsetRule = (CSSCharsetRule) rule;
assertEquals("iso-8859-1", charsetRule.getEncoding());
assertEquals(RULE, charsetRule.getCssText());
}
use of org.w3c.dom.css.CSSCharsetRule in project webtools.sourceediting by eclipse.
the class CSSCharsetRuleTest method testCreateRule.
public void testCreateRule() {
ICSSStyleSheet sheet = getStyleSheet();
ICSSDocument doc = sheet;
CSSCharsetRule newRule = doc.createCSSCharsetRule();
newRule.setEncoding("iso-8859-1");
sheet.insertRuleBefore(newRule, null);
CSSRuleList ruleList = sheet.getCssRules();
CSSRule rule = ruleList.item(0);
assertTrue(rule instanceof CSSCharsetRule);
CSSCharsetRule charsetRule = (CSSCharsetRule) rule;
assertEquals("iso-8859-1", charsetRule.getEncoding());
assertEquals(RULE, charsetRule.getCssText());
}
Aggregations