/* This is more complicated than it might look like it needs to be,
because for each subtest we have to splat stuff into the iframe,
allow the renderer to run, and only then interrogate the computed
styles. */
const checkTest = function() { var cd = frame.contentDocument; var _is = tests[curTest].todo ? todo_is : is; var _ok = tests[curTest].todo ? todo : ok;
if (cd.styleSheets[1].cssRules.length == 1 &&
cd.styleSheets[2].cssRules.length == 1) {
// If we have a .prop for this test, the .cssText of the reference
// and test rules will differ in the selector. Change #t to #r
// in the test rule. var ref_canon = cd.styleSheets[1].cssRules[0].cssText; var tst_canon = cd.styleSheets[2].cssRules[0].cssText;
tst_canon = tst_canon.replace(/(#|%23)t\b/, "$1r");
_is(tst_canon, ref_canon,
tests[curTest].name + " (canonicalized rule)");
} else {
_ok(false, tests[curTest].name + " (rule missing)");
}
if (tests[curTest].prop) { var prop = tests[curTest].prop; var pseudo = tests[curTest].pseudo;
var refElt = cd.getElementById("r"); var tstElt = cd.getElementById("t"); var refStyle = cd.defaultView.getComputedStyle(refElt, pseudo); var tstStyle = cd.defaultView.getComputedStyle(tstElt, pseudo);
_is(tstStyle.getPropertyValue(prop),
refStyle.getPropertyValue(prop),
tests[curTest].name + " (computed style)");
}
curTest++;
if (curTest < tests.length) {
prepareTest();
} else {
SimpleTest.finish();
}
};
¤ 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.0.1Bemerkung:
(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.