blob: bdd7157a807233c2c1f8b0796eef56edf571e063 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test.js"></script>
<script>
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
}
function getComputedStyleForElement(element, cssPropertyName)
{
if (!element) {
return null;
}
if (window.getComputedStyle) {
return window.getComputedStyle(element, '').getPropertyValue(cssPropertyName.replace(/([A-Z])/g, "-$1").toLowerCase());
}
if (element.currentStyle) {
return element.currentStyle[cssPropertyName];
}
return null;
}
function parsePixelValue(str)
{
if (typeof str != "string" || str.length < 3 || str.substr(str.length - 2) != "px") {
testFailed(str + " is unparsable.");
return -1;
}
return parseFloat(str);
}
function getHeight(id)
{
return parsePixelValue(getComputedStyleForElement(document.getElementById(id), 'height'));
}
function test()
{
description("This test checks that iframe with percentage height within table cell ignores the table cell height attribute (strict mode).");
shouldBe("getHeight('iframe-100')", "window.innerHeight");
isSuccessfullyParsed();
if (window.testRunner) {
testRunner.notifyDone();
}
}
</script>
<style>
html, body { height: 100%; margin: 0px; }
iframe { height: 100%;}
</style>
</head>
<body onload="test()">
<p id="description"></p>
<div id="console"></div>
<div style='height: 100%; display:table;'>
<div style='height: 100%; display:table-row;'>
<div style='display:table-cell;'>
<iframe id='iframe-100' frameborder='0px' src='data:text/html;charset=utf-8,<body></body>'></iframe>
</div>
</div>
</div>
</body>
</html>