div.style.setProperty(property, "revert");
const reverted = computedValue(div, property);
is(reverted, defaultValue, `${property}: Should behave as if there was no author style`); div.style.removeProperty(property);
kResetPropRule.style.removeProperty(property);
}
function testInheritedProperty(property, info) {
// Given how line-height works, and that it always returns the used value, we
// cannot test it. The prerequisites for line-height makes getComputedStyle
// and getDefaultComputedStyle return the same, even though the computed value
// is different (normal vs. 19px).
if (property == "line-height")
return;
const defaultValue = computedValue(kNoAuthorStylesDiv, property);
(hasUARule ? is : isnot)(defaultValue, inheritedValue, `${property}: Should get the non-inherited value from somewhere (expected ${hasUARule ? "UA Rule" : "inheritance"} - inherited: ${inheritedValue} - parent: ${parentValue} - default: ${defaultValue})`);
div.style.setProperty(property, "revert");
const reverted = computedValue(div, property);
if (hasUARule)
is(reverted, defaultValue, `${property}: Should behave as if there was no author style`);
else
is(reverted, inheritedValue, `${property}: Should behave as if there was no author style`); div.style.removeProperty(property);
}
function testProperty(property, info) {
if (info.prerequisites)
for (const prereq in info.prerequisites)
kPrerequisites.style.setProperty(prereq, info.prerequisites[prereq]);
if (info.inherited)
testInheritedProperty(property, info);
else
testResetProperty(property, info);
kPrerequisites.style = "";
}
for (const prop in gCSSProperties) {
const info = gCSSProperties[prop];
if (info.type != CSS_TYPE_LONGHAND)
continue;
kAllDifferentFromInitialRule.style.setProperty(prop, info.other_values[0]);
}
for (const prop in gCSSProperties)
testProperty(prop, gCSSProperties[prop]);
</script>
</pre>
Messung V0.5
¤ Dauer der Verarbeitung: 0.20 Sekunden
(vorverarbeitet)
¤
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.