function xfail_parse(descriptor, value) {
switch (descriptor) {
case "src":
// not clear whether this is an error or not, so mark todo for now
return value == "local(serif)";
}
return false;
}
function test_descriptor(descriptor)
{ var info = gCSSFontFaceDescriptors[descriptor];
function test_value(value) {
// // We don't implement SetProperty yet (bug 443978).
// gDeclaration.setProperty(descriptor, value, "");
fake_set_property(descriptor, value);
var idx;
var step1val = gDeclaration.getPropertyValue(descriptor); var step1ser = gDeclaration.cssText;
var func = xfail_parse(descriptor, value) ? todo_isnot : isnot;
func(step1val, "", "setting '" + value + "' on '" + descriptor + "'");
// We don't care particularly about the whitespace or the placement of
// semicolons, but for simplicity we'll test the current behavior. var expected_serialization = "";
if (step1val != "")
expected_serialization = descriptor + ": " + step1val + "; ";
is(step1ser, expected_serialization, "serialization should match descriptor value");
is(gDeclaration.getPropertyValue(descriptor), step1val, "parse+serialize should be idempotent for '" +
descriptor + ": " + value + "'");
gDeclaration.removeProperty(descriptor);
}
var idx;
for (idx in info.values)
test_value(info.values[idx]);
}
// To avoid triggering the slow scriptdialog, we have to test one
// descriptor at a time.
SimpleTest.waitForExplicitFinish();
function runTest() { var descs = [];
for (var desc in gCSSFontFaceDescriptors)
descs.push(desc);
descs = descs.reverse();
function do_one() {
if (descs.length == 0) {
SimpleTest.finish();
return;
}
test_descriptor(descs.pop());
SimpleTest.executeSoon(do_one);
}
SimpleTest.executeSoon(do_one);
}
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.