function do_test() {
const DOCUMENT_NODE_TYPE = 9;
variframe = document.getElementById("bug462789_iframe"); var docElement = iframe.contentDocument.documentElement; varbody = docElement.children[1]; var rule = iframe.contentDocument.styleSheets[0].cssRules[0]; var text = body.firstChild;
try { var res = InspectorUtils.getMatchingCSSRules(docElement);
is(res.length, 0, "getMatchingCSSRules");
res = InspectorUtils.getMatchingCSSRules(body);
is(res.length, 0, "getMatchingCSSRules");
}
catch(e) { ok(false, "got an unexpected exception:" + e); }
try { var res = InspectorUtils.getRuleLine(rule);
is(res, 1, "getRuleLine");
}
catch(e) { ok(false, "got an unexpected exception:" + e); }
try { var res = InspectorUtils.isIgnorableWhitespace(text);
is(res, false, "isIgnorableWhitespace");
}
catch(e) { ok(false, "got an unexpected exception:" + e); }
try { var res = InspectorUtils.getParentForNode(docElement, true);
is(res.nodeType, DOCUMENT_NODE_TYPE, "getParentForNode(docElement, true)");
res = InspectorUtils.getParentForNode(text, true);
is(res.tagName, "BODY", "getParentForNode(text, true)");
}
catch(e) { ok(false, "got an unexpected exception:" + e); }
try {
InspectorUtils.getContentState(docElement);
ok(true, "Should not throw");
}
catch(e) { ok(false, "Got an exception: " + e); }
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.