REGRESSION(r143102): iframe with percentage height within table with anonymous cell fails.

https://bugs.webkit.org/show_bug.cgi?id=113077

Source/WebCore:

Patch by Zalan Bujtas <zalan@apple.com> on 2013-03-27
Reviewed by Antti Koivisto.

http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level
"Anonymous block boxes are ignored when resolving percentage values that would refer to it:
the closest non-anonymous ancestor box is used instead."
When figuring out whether auto height needs to be applied on the current box, ignore anonymous
ancestors until the first non-anonymous containing block is found. This matches both
Firefox and Opera behaviour.

Test: fast/replaced/iframe-with-percentage-height-within-table-with-anonymous-table-cell.html

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight): Switch from
isAnonymousBlock() to isAnonymous() to make sure all anonymous boxes are ignored.
Remove isTableCell() check which is a noop as table cell isn't an anonymous block.

LayoutTests:

Patch by Zalan Bujtas <zalan@apple.com> on 2013-03-27
Reviewed by Antti Koivisto.

* fast/replaced/iframe-with-percentage-height-within-table-with-anonymous-table-cell-expected.txt: Added.
* fast/replaced/iframe-with-percentage-height-within-table-with-anonymous-table-cell.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147021 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 796b9ac7
2013-03-27 Zalan Bujtas <zalan@apple.com>
REGRESSION(r143102): iframe with percentage height within table with anonymous cell fails.
https://bugs.webkit.org/show_bug.cgi?id=113077
Reviewed by Antti Koivisto.
* fast/replaced/iframe-with-percentage-height-within-table-with-anonymous-table-cell-expected.txt: Added.
* fast/replaced/iframe-with-percentage-height-within-table-with-anonymous-table-cell.html: Added.
2013-03-27 Pierre Rossi <pierre.rossi@gmail.com>
[Qt] Add WOFF support when using zlib
This test checks that iframe with percentage height within anonymous table cell has the correct height (strict mode).
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS getHeight('iframe-100') is window.innerHeight
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE html>
<head>
<title>Test for embedded iframe with height: 100% and anonymous table cell parent.</title>
<script src="../js/resources/js-test-pre.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 anonymous table cell has the correct height (strict mode).");
shouldBe("getHeight('iframe-100')", "window.innerHeight");
isSuccessfullyParsed();
if (window.testRunner) {
testRunner.notifyDone();
}
}
</script>
<style>
html, body {
height: 100%;
}
</style>
</head>
<body onload="test()">
<p id="description"></p>
<div id="console"></div>
<div style="display:table; height: 100%;">
<div style="display:table-row; height: 100%;">
<iframe id="iframe-100" frameborder="0px" style="height: 100%;" src=""></iframe>
</div>
</div>
</body>
</html>
2013-03-27 Zalan Bujtas <zalan@apple.com>
REGRESSION(r143102): iframe with percentage height within table with anonymous cell fails.
https://bugs.webkit.org/show_bug.cgi?id=113077
Reviewed by Antti Koivisto.
http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level
"Anonymous block boxes are ignored when resolving percentage values that would refer to it:
the closest non-anonymous ancestor box is used instead."
When figuring out whether auto height needs to be applied on the current box, ignore anonymous
ancestors until the first non-anonymous containing block is found. This matches both
Firefox and Opera behaviour.
Test: fast/replaced/iframe-with-percentage-height-within-table-with-anonymous-table-cell.html
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight): Switch from
isAnonymousBlock() to isAnonymous() to make sure all anonymous boxes are ignored.
Remove isTableCell() check which is a noop as table cell isn't an anonymous block.
2013-03-27 Pierre Rossi <pierre.rossi@gmail.com>
[Qt] Add WOFF support when using zlib
......@@ -380,12 +380,11 @@ bool RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight() const
if (!logicalHeightLength.isPercent() || isOutOfFlowPositioned() || document()->inQuirksMode())
return false;
// Anonymous block boxes are ignored when resolving percentage values that would refer to it:
// the closest non-anonymous ancestor box is used instead.
RenderBlock* cb = containingBlock();
while (cb->isAnonymousBlock()) {
if (cb->isTableCell())
return true;
while (cb->isAnonymous())
cb = cb->containingBlock();
}
if (!cb->style()->logicalHeight().isAuto() || (!cb->style()->logicalTop().isAuto() && !cb->style()->logicalBottom().isAuto()))
return false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment