<!DOCTYPE HTML >
<html >
<head >
<title >Test InspectorUtils.valueMatchesSyntax</title >
<script src="/tests/SimpleTest/SimpleTest.js" ></script >
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head >
<body >
<code >InspectorUtils.valueMatchesSyntax</code >
<script >
add_task(async function() {
const test = (value, syntax, expected) =>
is(
SpecialPowers.InspectorUtils.valueMatchesSyntax(document, value, syntax),
expected,
`"${value}" ${expected ? "matches" : "does not match" } "${syntax}" `
);
test("red" , "" , true);
test("10px" , "" , false);
test("10px" , " | " , true);
test("10px 1em" , "+" , true);
test("10px, 1em" , "+" , false);
test("10px, 1em" , "#" , true);
test("10px 1em" , "#" , false);
test("calc(100% - 20px)" , "" , false);
test("calc(100% - 20px)" , "" , true);
test("big" , "big | bigger | BIGGER" , true);
test("bigger" , "big | bigger | BIGGER" , true);
test("BIGGER" , "big | bigger | BIGGER" , true);
test("BIG" , "big | bigger | BIGGER" , false);
test("red" , "" , false);
test("whatever 10px, 1em red" , "*" , true);
info("CSS-wide keyword are considered to be matching the syntax" );
test("initial" , "" , true);
test("inherit" , "" , true);
test("unset" , "" , true);
test("revert" , "" , true);
test("revert-layer" , "" , true);
});
</script >
</body >
</html >
Messung V0.5 C=100 H=100 G=100
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
*© Formatika GbR, Deutschland