/** Test for Bug 969460: Test that "display" on the root node is computed
using the same conversion that we use for display on floated elements **/
function test_display_value(val)
{ var floatElem = document.getElementById("float");
floatElem.style.display = val; var floatConversion = window.getComputedStyle(floatElem).display;
floatElem.style.display = "";
var rootNode = document.documentElement;
rootNode.style.display = val;
rootNode.offsetHeight; // (Flush layout, to be sure layout can handle 'val') var rootConversion = window.getComputedStyle(rootNode).display;
rootNode.style.display = "";
// Special case: "display:list-item" does not get modified by 'float',
// but the spec allows us to convert it to 'block' on the root node
// (and we do convert it, so that we don't have to support documents whose
// root node is a list-item).
if (val == "list-item") {
is(floatConversion, val, "'float' shouldn't affect 'display:list-item'");
is(rootConversion, "block", "We traditionally convert '" + val + "' on the root node to " + "'display:block' (though if that changes, it's not technically a bug, " + "as long as we support it properly).");
} else if (val == "inline list-item" ||
val == "inline flow-root list-item") {
is(floatConversion, "list-item", "'float' should blockify '" + val + "'");
is(rootConversion, "block", "We traditionally convert '" + val + "' on the root node to " + "'display:block' (though if that changes, it's not technically a bug, " + "as long as we support it properly).");
} else if (val == "contents") {
is(floatConversion, val, "'float' shouldn't affect 'display:contents'");
is(rootConversion, "block", "'display:contents' on the root node computes to block-level per" + "http://dev.w3.org/csswg/css-display/#transformations");
} else {
is(rootConversion, floatConversion, "root node should make 'display:" + val + "' compute to the same " + "value that it computes to on a floated element");
}
}
var displayInfo = gCSSProperties.display;
displayInfo.initial_values.forEach(test_display_value);
displayInfo.other_values.forEach(test_display_value);
</script>
</pre>
</body>
</html>
Messung V0.5
¤ Dauer der Verarbeitung: 0.0 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.