let results = [];
for (let sheet of InspectorUtils.getAllStyleSheets(document)) {
if (sheet.href === agentUrl) {
is(sheet.parsingMode, "agent", "agent sheet has expected mode");
results[sss.AGENT_SHEET] = 1;
} else if (sheet.href === userUrl) {
is(sheet.parsingMode, "user", "user sheet has expected mode");
is(sheet.cssRules[0].style.length, 2, "Chrome-only properties are parsed in user sheet")
results[sss.USER_SHEET] = 1;
} else if (sheet.href === authorUrl) {
is(sheet.parsingMode, "author", "author sheet has expected mode");
results[sss.AUTHOR_SHEET] = 1;
} else {
// Ignore sheets we don't care about.
continue;
}
// Check that re-parsing preserves the mode.
let mode = sheet.parsingMode;
let text = sheetText(sheet);
InspectorUtils.parseStyleSheet(sheet, "body { color: chartreuse; }");
if (mode == "agent") {
is(sheetText(sheet), text, "Reparsing should not have changed a UA sheet");
} else {
isnot(sheetText(sheet), text, "Reparsing should have changed a non-UA sheet");
}
is(sheet.parsingMode, mode, "check that re-parsing preserved mode " + mode);
}
ok(results[sss.AGENT_SHEET] && results[sss.USER_SHEET] &&
results[sss.AUTHOR_SHEET], "all sheets seen");
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.