Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Display: getComputedStyle().display</title>
<link rel="author" title="Ethan Jimenez" href="mailto:ethavar@microsoft.com">
<meta name="assert" content="position and float can change display computed value.">
<meta name="assert" content="display computed value is otherwise as specified.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
</head>
<body>
<div id="target"></div>
<script>
'use strict';
test_computed_value("display", "masonry");
test_computed_value("display", "inline-masonry");
function test_display_affected(property, value) {
const target = document.getElementById('target');
test(() => {
target.style[property] = value;
target.style.display = 'inline-masonry';
assert_equals(getComputedStyle(target).display, 'masonry', 'inline-masonry -> masonry');
target.style[property] = '';
target.style.display = '';
}, property + ' ' + value + ' affects computed display');
}
test_display_affected("position", "absolute");
test_display_affected("position", "fixed");
test_display_affected("float", "left");
test_display_affected("float", "right");
</script>
</body>
</html>