var gLengthValues = [ "inherit", "initial", "2px", "1em", "unset" ]; var gColorValues = [ "inherit", "initial", "currentColor", "green", "unset" ]; var gStyleValues = [ "inherit", "initial", "double", "dashed", "unset" ];
function values_for(set) { var values;
if (set[0].match(/style$/))
values = gStyleValues;
else if (set[0].match(/color$/))
values = gColorValues;
else
values = gLengthValues;
return values;
}
var e = document.getElementById("display"); var s = e.style; var c = window.getComputedStyle(e);
for (var set of gProps) { var values = values_for(set);
for (var val of values) {
function check(dir, plogical, pvisual) { var v0 = c.getPropertyValue(pvisual);
s.setProperty("direction", dir, "");
s.setProperty(pvisual, val, ""); var v1 = c.getPropertyValue(pvisual);
if (val != "initial" && val != "unset" && val != "currentColor")
isnot(v1, v0, "setProperty set the property " + pvisual + ": " + val);
s.removeProperty(pvisual);
is(c.getPropertyValue(pvisual), v0, "removeProperty worked for " + pvisual);
s.setProperty(plogical, val, "") var v2 = c.getPropertyValue(pvisual);
is(v2, v1, "the logical property " + plogical + ": " + val + " showed up in the right place");
s.removeProperty(plogical);
is(c.getPropertyValue(pvisual), v0, "removeProperty worked for " + plogical);
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.